Added: Container Switch

This commit is contained in:
2025-09-19 16:32:49 +02:00
parent 49e4f0e7ef
commit ac8850ae00
24 changed files with 361 additions and 107 deletions

View 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" ];
};
*/
};
}