diff options
author | Charles Strahan <charles@cstrahan.com> | 2016-04-30 00:19:57 -0400 |
---|---|---|
committer | Charles Strahan <charles@cstrahan.com> | 2016-10-11 19:59:00 -0400 |
commit | da36847d925058fd86f027b64cc712c57be11ad8 (patch) | |
tree | 232dd7e5aa3188fc587392a0bbc180d3e3b44e0b /nixos/modules/system | |
parent | 9ce4e47bf6acccbb586c8caaf6f2bcf20789ac39 (diff) | |
download | nixpkgs-da36847d925058fd86f027b64cc712c57be11ad8.tar nixpkgs-da36847d925058fd86f027b64cc712c57be11ad8.tar.gz nixpkgs-da36847d925058fd86f027b64cc712c57be11ad8.tar.bz2 nixpkgs-da36847d925058fd86f027b64cc712c57be11ad8.tar.lz nixpkgs-da36847d925058fd86f027b64cc712c57be11ad8.tar.xz nixpkgs-da36847d925058fd86f027b64cc712c57be11ad8.tar.zst nixpkgs-da36847d925058fd86f027b64cc712c57be11ad8.zip |
nixos: make it easy to apply kernel patches
This makes it easy to specify kernel patches: boot.kernelPatches = [ pkgs.kernelPatches.ubuntu_fan_4_4 ]; To make the `boot.kernelPatches` option possible, this also makes it easy to extend and/or modify the kernel packages within a linuxPackages set. For example: pkgs.linuxPackages.extend (self: super: { kernel = super.kernel.override { kernelPatches = super.kernel.kernelPatches ++ [ pkgs.kernelPatches.ubuntu_fan_4_4 ]; }; }); Closes #15095
Diffstat (limited to 'nixos/modules/system')
-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 ba15d0318b1..51b3b8a3dca 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 = [ ]; |