diff options
| author | Fuwn <[email protected]> | 2024-09-20 05:45:43 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-09-20 05:45:43 -0700 |
| commit | 9e5f5c54d9ca9e976541f65d2b76bb723a807aca (patch) | |
| tree | e87c9ff000a04241bd4e48c041c0f66e47df4877 /modules | |
| parent | modules: server and core modules (diff) | |
| download | nixos-config-9e5f5c54d9ca9e976541f65d2b76bb723a807aca.tar.xz nixos-config-9e5f5c54d9ca9e976541f65d2b76bb723a807aca.zip | |
server: modular container engine
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/options/default.nix | 19 | ||||
| -rw-r--r-- | modules/server/systemd.nix | 4 | ||||
| -rw-r--r-- | modules/server/virtualisation.nix | 4 |
3 files changed, 20 insertions, 7 deletions
diff --git a/modules/options/default.nix b/modules/options/default.nix index bd831dc..97afab3 100644 --- a/modules/options/default.nix +++ b/modules/options/default.nix @@ -1,7 +1,20 @@ { lib, ... }: +with lib.options; +with lib.types; { - options.modules.nix.extend = lib.options.mkOption { - default = true; - type = lib.types.bool; + options.modules = { + nix.extend = mkOption { + default = true; + type = types.bool; + }; + + server.containerEngine = mkOption { + default = "podman"; + + type = types.enum [ + "podman" + "docker" + ]; + }; }; } diff --git a/modules/server/systemd.nix b/modules/server/systemd.nix index acdcef4..8d0b118 100644 --- a/modules/server/systemd.nix +++ b/modules/server/systemd.nix @@ -1,6 +1,6 @@ -{ secrets, ... }: +{ secrets, config, ... }: let - containerEngine = "podman"; + inherit (config.modules.server) containerEngine; in { systemd.services.tailscale-up = { diff --git a/modules/server/virtualisation.nix b/modules/server/virtualisation.nix index 3d8effe..0bda69e 100644 --- a/modules/server/virtualisation.nix +++ b/modules/server/virtualisation.nix @@ -1,6 +1,6 @@ -{ secrets, ... }: +{ secrets, config, ... }: let - containerEngine = "podman"; + inherit (config.modules.server) containerEngine; in { virtualisation = { |