modules.system.kernel: allow null variant

This commit is contained in:
2024-11-29 13:16:28 +08:00
parent 2423a0b68f
commit eaf74c6f3b
4 changed files with 10 additions and 9 deletions

View File

@@ -26,7 +26,7 @@ inputs:
};
nixpkgs.march = "skylake";
nix = { substituters = [ "https://nix-store.chn.moe?priority=100" ]; githubToken.enable = true; };
kernel.patches = [ "surface" "hibernate-progress" ];
kernel = { variant = null; patches = [ "hibernate-progress" ]; };
};
hardware = { cpus = [ "intel" ]; gpu.type = "intel"; };
services =

10
flake.lock generated
View File

@@ -879,15 +879,15 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1732536142,
"narHash": "sha256-DlwQrOBZET55+tOy2eO3DdAmH9B5xSQzj0TcuWClyF8=",
"owner": "CHN-beta",
"lastModified": 1732483221,
"narHash": "sha256-kF6rDeCshoCgmQz+7uiuPdREVFuzhIorGOoPXMalL2U=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "20d99c009ced76a49be02d7ba709b2ce5378c806",
"rev": "45348ad6fb8ac0e8415f6e5e96efe47dd7f39405",
"type": "github"
},
"original": {
"owner": "CHN-beta",
"owner": "NixOS",
"repo": "nixos-hardware",
"type": "github"
}

View File

@@ -19,7 +19,7 @@
inputs = { nixpkgs.follows = "nixpkgs"; home-manager.follows = "home-manager"; };
};
nur-linyinfeng = { url = "github:linyinfeng/nur-packages"; inputs.nixpkgs.follows = "nixpkgs"; };
nixos-hardware.url = "github:CHN-beta/nixos-hardware";
nixos-hardware.url = "github:NixOS/nixos-hardware";
envfs = { url = "github:Mic92/envfs"; inputs.nixpkgs.follows = "nixpkgs"; };
nix-flatpak.url = "github:gmodena/nix-flatpak";
chaotic =

View File

@@ -4,7 +4,8 @@ inputs:
{
variant = mkOption
{
type = types.enum [ "nixos" "xanmod-lts" "xanmod-latest" "cachyos" "cachyos-lto" "cachyos-server" "zen" ];
type = types.nullOr (types.enum
[ "nixos" "xanmod-lts" "xanmod-latest" "cachyos" "cachyos-lto" "cachyos-server" "zen" ]);
default = "xanmod-lts";
};
patches = mkOption { type = types.listOf types.nonEmptyStr; default = []; };
@@ -38,7 +39,7 @@ inputs:
extraModulePackages = with inputs.config.boot.kernelPackages; [ v4l2loopback zenpower ];
extraModprobeConfig = builtins.concatStringsSep "\n" kernel.modules.modprobeConfig;
kernelParams = [ "delayacct" ];
kernelPackages =
kernelPackages = inputs.lib.mkIf (kernel.variant != null)
{
nixos = inputs.pkgs.linuxPackages;
xanmod-lts = inputs.pkgs.linuxPackages_xanmod;