diff options
| author | getchoo-bot[bot] <183349775+getchoo-bot[bot]@users.noreply.github.com> | 2024-10-18 21:04:48 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-10-18 21:04:48 +0000 |
| commit | 797075634ca9c741c48c7733c81c920384d1ae86 (patch) | |
| tree | 25a6acdc15d9d630d9c52758a80493caa6d33b2a /modules/nixos/traits | |
| parent | 1671897cfb636b059b0771c159f98bbf85b5d085 (diff) | |
flake: update nixpkgs (#476)
* flake: update nixpkgs
* nixos/containers: set `hardware.nvidia-container-toolkit` in nvidia module
---------
Co-authored-by: getchoo-bot[bot] <183349775+getchoo-bot[bot]@users.noreply.github.com>
Co-authored-by: seth <[email protected]>
Diffstat (limited to 'modules/nixos/traits')
| -rw-r--r-- | modules/nixos/traits/containers.nix | 32 | ||||
| -rw-r--r-- | modules/nixos/traits/nvidia.nix | 4 |
2 files changed, 14 insertions, 22 deletions
diff --git a/modules/nixos/traits/containers.nix b/modules/nixos/traits/containers.nix index 407ee51..b684803 100644 --- a/modules/nixos/traits/containers.nix +++ b/modules/nixos/traits/containers.nix @@ -10,29 +10,17 @@ in { options.traits.containers = { enable = lib.mkEnableOption "support for containers"; - enableNvidia = lib.mkEnableOption "the use of nvidia-container-toolkit" // { - default = lib.elem "nvidia" config.services.xserver.videoDrivers; - defaultText = lib.literalExpression '' - lib.elem "nvidia" config.services.xserver.videoDrivers - ''; - }; }; - config = lib.mkIf cfg.enable ( - lib.mkMerge [ - { - virtualisation = { - podman = { - enable = true; - extraPackages = [ pkgs.podman-compose ]; - autoPrune.enable = true; - }; - - oci-containers.backend = "podman"; - }; - } + config = lib.mkIf cfg.enable { + virtualisation = { + podman = { + enable = true; + extraPackages = [ pkgs.podman-compose ]; + autoPrune.enable = true; + }; - (lib.mkIf cfg.enableNvidia { hardware.nvidia-container-toolkit.enable = true; }) - ] - ); + oci-containers.backend = "podman"; + }; + }; } diff --git a/modules/nixos/traits/nvidia.nix b/modules/nixos/traits/nvidia.nix index dab26c8..bd57108 100644 --- a/modules/nixos/traits/nvidia.nix +++ b/modules/nixos/traits/nvidia.nix @@ -50,6 +50,10 @@ in }; }; }) + + (lib.mkIf config.traits.containers.enable { + hardware.nvidia-container-toolkit.enable = true; + }) ] ); } |
