Added: Container Switch
This commit is contained in:
41
modules/containerization/default.nix
Normal file
41
modules/containerization/default.nix
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
containerization ? "none",
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
# Import the appropriate containerization module based on the parameter
|
||||
containerModule =
|
||||
if containerization == "podman" then
|
||||
import ./podman.nix
|
||||
else if containerization == "docker" then
|
||||
import ./docker.nix
|
||||
else if containerization == "none" then
|
||||
{ }
|
||||
else
|
||||
throw "Unknown containerization type: ${containerization}. Valid options are: podman, docker, none";
|
||||
in
|
||||
|
||||
{
|
||||
imports = [ containerModule ];
|
||||
|
||||
# Common packages and configuration for all systems
|
||||
environment.systemPackages = with pkgs; [
|
||||
# Remove the curly braces {}
|
||||
dive # docker layer viewer
|
||||
tailscale # VPN
|
||||
];
|
||||
|
||||
virtualisation.containers.enable = true;
|
||||
virtualisation.oci-containers.containers = {
|
||||
/*
|
||||
container-name = {
|
||||
image = "image";
|
||||
autoStart = true;
|
||||
ports = [ "127.0.0.1:1234:1234" ];
|
||||
};
|
||||
*/
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user