diff options
Diffstat (limited to 'nixos/modules/system/boot/kernel.nix')
-rw-r--r-- | nixos/modules/system/boot/kernel.nix | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/nixos/modules/system/boot/kernel.nix b/nixos/modules/system/boot/kernel.nix index ba15d0318b177..51b3b8a3dca97 100644 --- a/nixos/modules/system/boot/kernel.nix +++ b/nixos/modules/system/boot/kernel.nix @@ -4,7 +4,9 @@ with lib; let - kernel = config.boot.kernelPackages.kernel; + inherit (config.boot) kernelPatches; + + inherit (config.boot.kernelPackages) kernel; kernelModulesConf = pkgs.writeText "nixos.conf" '' @@ -21,6 +23,11 @@ in boot.kernelPackages = mkOption { default = pkgs.linuxPackages; + apply = kernelPackages: kernelPackages.extend (self: super: { + kernel = super.kernel.override { + kernelPatches = super.kernel.kernelPatches ++ kernelPatches; + }; + }); # We don't want to evaluate all of linuxPackages for the manual # - some of it might not even evaluate correctly. defaultText = "pkgs.linuxPackages"; @@ -39,6 +46,13 @@ in ''; }; + boot.kernelPatches = mkOption { + type = types.listOf types.attrs; + default = []; + example = literalExample "[ pkgs.kernelPatches.ubuntu_fan_4_4 ]"; + description = "A list of additional patches to apply to the kernel."; + }; + boot.kernelParams = mkOption { type = types.listOf types.str; default = [ ]; |