diff options
Diffstat (limited to 'archetypes/profiles')
| -rw-r--r-- | archetypes/profiles/cuda/default.nix | 28 | ||||
| -rw-r--r-- | archetypes/profiles/default.nix | 1 |
2 files changed, 29 insertions, 0 deletions
diff --git a/archetypes/profiles/cuda/default.nix b/archetypes/profiles/cuda/default.nix new file mode 100644 index 0000000..14de560 --- /dev/null +++ b/archetypes/profiles/cuda/default.nix @@ -0,0 +1,28 @@ +{ lib, pkgs, ... }: let + mkCuda = lib.mkOverride 800; + + nixosConfig = { + # Binary cache packages built with cudaSupport + nix.settings = { + substituters = mkCuda [ "https://cache.nixos-cuda.org" ]; + trusted-public-keys = mkCuda [ "cache.nixos-cuda.org:74DUi4Ye579gUqzH4ziL9IyiJBlDpMRn9MBN8oNan9M=" ]; + }; + + # Enable cudaSupport + nixpkgs.config.cudaSupport = mkCuda true; + + # Nvidia packages + environment.systemPackages = with pkgs; mkCuda [ + config.hardware.nvidia.package # nvidia-smi + nvtopPackages.nvidia + ]; + + # Enable nvidia graphics + services.xserver.videoDrivers = mkCuda [ "nvidia" ]; # xserver.videoDrivers does not imply X + hardware.graphics.enable = mkCuda true; + }; + + homeConfig = {}; +in { + imports = [ (lib._mkProfileArchetype "cuda" nixosConfig homeConfig) ]; +} diff --git a/archetypes/profiles/default.nix b/archetypes/profiles/default.nix index 23b5c05..ef5d87b 100644 --- a/archetypes/profiles/default.nix +++ b/archetypes/profiles/default.nix @@ -1,6 +1,7 @@ { imports = [ ./btrfs + ./cuda ./desktop ./headless ./pi |
