diff options
| author | seth <[email protected]> | 2024-02-28 07:31:21 -0500 |
|---|---|---|
| committer | seth <[email protected]> | 2024-02-28 07:31:21 -0500 |
| commit | 4caa14d0416c8ac14e0ac617a1eec22b9df830f6 (patch) | |
| tree | ab2a295461a046118841c046fc1d6a3b6bbf7c38 /modules/nixos/traits/containers.nix | |
| parent | ed23d606f190aa20e620063ab65e78caf613b67c (diff) | |
nixos: remove root password
Diffstat (limited to 'modules/nixos/traits/containers.nix')
| -rw-r--r-- | modules/nixos/traits/containers.nix | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/modules/nixos/traits/containers.nix b/modules/nixos/traits/containers.nix index e309a89..10824eb 100644 --- a/modules/nixos/traits/containers.nix +++ b/modules/nixos/traits/containers.nix @@ -11,28 +11,30 @@ in { enable = lib.mkEnableOption "containers support"; }; - config.virtualisation = lib.mkMerge [ - (lib.mkIf cfg.enable { - podman = { - enable = true; - extraPackages = with pkgs; [podman-compose]; - autoPrune.enable = true; - }; + config.virtualisation = lib.mkIf cfg.enable ( + lib.mkMerge [ + { + podman = { + enable = true; + extraPackages = with pkgs; [podman-compose]; + autoPrune.enable = true; + }; - oci-containers.backend = "podman"; - }) - - (let - enable = lib.mkDefault ( - lib.elem "nvidia" (config.services.xserver.videoDrivers or []) - ); - in - if (options.virtualisation.containers ? cdi) - then { - containers.cdi.dynamic.nvidia = {inherit enable;}; + oci-containers.backend = "podman"; } - else { - podman.enableNvidia = enable; - }) - ]; + + (let + enable = lib.mkDefault ( + lib.elem "nvidia" (config.services.xserver.videoDrivers or []) + ); + in + if (options.virtualisation.containers ? cdi) + then { + containers.cdi.dynamic.nvidia = {inherit enable;}; + } + else { + podman.enableNvidia = enable; + }) + ] + ); } |
