feat: add cuda setup

This commit is contained in:
DACHXY 2025-01-05 23:01:08 +08:00
parent 4d0a35652c
commit d5782ada85
4 changed files with 33 additions and 2 deletions

View file

@ -46,6 +46,10 @@
}@inputs:
let
system = "x86_64-linux";
pkgs = import nixpkgs {
system = "x86_64-linux";
config.allowUnfree = true;
};
nix-version = "25.05";
username = "danny";
git-config = {
@ -67,6 +71,7 @@
nix-version
username
git-config
pkgs
;
};
};
@ -83,6 +88,7 @@
nix-version
username
git-config
pkgs
;
};
};

View file

@ -24,6 +24,7 @@ in
./hardware-configuration.nix
./boot.nix
../../modules
../../modules/cuda.nix
(import ../../modules/nvidia.nix {
nvidia-mode = nvidia-mode;
intel-bus-id = intel-bus-id;

21
system/modules/cuda.nix Normal file
View file

@ -0,0 +1,21 @@
# Here only set the environment for cuda shell env
# For futher, see flake: https://github.com/DACHXY/python-cuda-flake
{ lib, ... }:
{
nix = {
settings = {
substituters = [
"https://cuda-maintainers.cachix.org"
"https://cache.nixos.org/"
];
trusted-public-keys = [
"cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
];
};
};
nixpkgs.config.allowUnfreePredicate =
pkg:
builtins.elem (lib.getName pkg) [
"cuda-merged"
];
}

View file

@ -7,6 +7,9 @@
{
environment.systemPackages =
(with pkgs; [
# Binary cache platform
cachix
# gtk theme
gtk3
adwaita-icon-theme
@ -90,7 +93,7 @@
# Thumbnail
ffmpegthumbnailer
])
++ ([
++ [
inputs.ghostty.packages.${system}.default
]);
];
}