Commit faeeead

HPCesia <me@hpcesia.com>
2025-10-03 18:03:35
fix: cuda support
1 parent b8d87aa
Changed files (4)
modules
core
flake
gen-configuration
hosts
chaser-kevin
modules/core/nix/nixpkgs.nix
@@ -0,0 +1,10 @@
+{inputs, ...}: {
+  flake.modules.nixos.core = _: {
+    # nixos modules' nixpkgs config, will affect all nixos modules
+    # flake-parts global nixpkgs config: modules/flake/nixpkgs.nix
+    nixpkgs.config = {allowUnfree = true;};
+    nixpkgs.overlays = [
+      inputs.nur.overlays.default
+    ];
+  };
+}
modules/flake/gen-configuration/nixos.nix
@@ -25,7 +25,7 @@ in {
         name: module: {
           inherit name;
           value = withSystem config.flake.meta.host.hosts.${name}.system (
-            {pkgs, ...}:
+            {system, ...}:
               inputs.nixpkgs.lib.nixosSystem {
                 # TODO: remove below after migrated all config to Dendritic Pattern
                 specialArgs =
@@ -47,7 +47,7 @@ in {
                   module
                   {
                     networking.hostName = name;
-                    nixpkgs.pkgs = pkgs;
+                    nixpkgs.system = system;
                   }
                 ];
               }
modules/flake/nixpkgs.nix
@@ -1,5 +1,7 @@
 {inputs, ...}: {
   perSystem = {system, ...}: {
+    # flake-parts global nixpkgs config, nixos modules' nixpkgs will not be affected
+    # nixos modules nixpkgs config: modules/core/nix/nixpkgs.nix
     _module.args.pkgs = import inputs.nixpkgs {
       inherit system;
       config = {allowUnfree = true;};
modules/hosts/chaser-kevin/hardware.nix
@@ -31,6 +31,7 @@
     };
     services.xserver.videoDrivers = ["nvidia" "modesetting"];
     hardware.graphics.enable = true;
+    nixpkgs.config.cudaSupport = true;
 
     # Thunderbolt
     services.hardware.bolt.enable = true;