42 lines
936 B
Nix
42 lines
936 B
Nix
{
|
|
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" ];
|
|
};
|
|
*/
|
|
};
|
|
}
|