diff options
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; + }) + ] + ); } |
