boot.kernel.features: add nixos option for setting kernel features

this allows setting the features attribute for
pkgs/os-specific/linux/kernel/common-config.nix

authored by

Herwig Hochleitner and committed by
Herwig Hochleitner
0b621321 ea484952

+11 -1
+11 -1
nixos/modules/system/boot/kernel.nix
··· 5 let 6 7 inherit (config.boot) kernelPatches; 8 - 9 inherit (config.boot.kernelPackages) kernel; 10 11 kernelModulesConf = pkgs.writeText "nixos.conf" ··· 21 22 options = { 23 24 boot.kernelPackages = mkOption { 25 default = pkgs.linuxPackages; 26 apply = kernelPackages: kernelPackages.extend (self: super: { 27 kernel = super.kernel.override { 28 kernelPatches = super.kernel.kernelPatches ++ kernelPatches; 29 }; 30 }); 31 # We don't want to evaluate all of linuxPackages for the manual
··· 5 let 6 7 inherit (config.boot) kernelPatches; 8 + inherit (config.boot.kernel) features; 9 inherit (config.boot.kernelPackages) kernel; 10 11 kernelModulesConf = pkgs.writeText "nixos.conf" ··· 21 22 options = { 23 24 + boot.kernel.features = mkOption { 25 + default = {}; 26 + example = literalExample "{ debug = true; }"; 27 + description = '' 28 + This option allows to enable or disable certain kernel features. 29 + grep features pkgs/os-specific/linux/kernel/common-config.nix 30 + ''; 31 + }; 32 + 33 boot.kernelPackages = mkOption { 34 default = pkgs.linuxPackages; 35 apply = kernelPackages: kernelPackages.extend (self: super: { 36 kernel = super.kernel.override { 37 kernelPatches = super.kernel.kernelPatches ++ kernelPatches; 38 + features = lib.recursiveUpdate super.kernel.features features; 39 }; 40 }); 41 # We don't want to evaluate all of linuxPackages for the manual