mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
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
This commit is contained in:
parent
ea48495249
commit
0b621321cd
1 changed files with 11 additions and 1 deletions
|
@ -5,7 +5,7 @@ with lib;
|
||||||
let
|
let
|
||||||
|
|
||||||
inherit (config.boot) kernelPatches;
|
inherit (config.boot) kernelPatches;
|
||||||
|
inherit (config.boot.kernel) features;
|
||||||
inherit (config.boot.kernelPackages) kernel;
|
inherit (config.boot.kernelPackages) kernel;
|
||||||
|
|
||||||
kernelModulesConf = pkgs.writeText "nixos.conf"
|
kernelModulesConf = pkgs.writeText "nixos.conf"
|
||||||
|
@ -21,11 +21,21 @@ in
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
|
|
||||||
|
boot.kernel.features = mkOption {
|
||||||
|
default = {};
|
||||||
|
example = literalExample "{ debug = true; }";
|
||||||
|
description = ''
|
||||||
|
This option allows to enable or disable certain kernel features.
|
||||||
|
grep features pkgs/os-specific/linux/kernel/common-config.nix
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
boot.kernelPackages = mkOption {
|
boot.kernelPackages = mkOption {
|
||||||
default = pkgs.linuxPackages;
|
default = pkgs.linuxPackages;
|
||||||
apply = kernelPackages: kernelPackages.extend (self: super: {
|
apply = kernelPackages: kernelPackages.extend (self: super: {
|
||||||
kernel = super.kernel.override {
|
kernel = super.kernel.override {
|
||||||
kernelPatches = super.kernel.kernelPatches ++ kernelPatches;
|
kernelPatches = super.kernel.kernelPatches ++ kernelPatches;
|
||||||
|
features = lib.recursiveUpdate super.kernel.features features;
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
# We don't want to evaluate all of linuxPackages for the manual
|
# We don't want to evaluate all of linuxPackages for the manual
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue