Merge pull request #210091 from K900/better-kernel-docs
nixos/kernel: better docs for boot.kernelPatches
This commit is contained in:
commit
9b41185df8
|
@ -73,8 +73,45 @@ in
|
||||||
boot.kernelPatches = mkOption {
|
boot.kernelPatches = mkOption {
|
||||||
type = types.listOf types.attrs;
|
type = types.listOf types.attrs;
|
||||||
default = [];
|
default = [];
|
||||||
example = literalExpression "[ pkgs.kernelPatches.ubuntu_fan_4_4 ]";
|
example = literalExpression ''
|
||||||
description = lib.mdDoc "A list of additional patches to apply to the kernel.";
|
[
|
||||||
|
{
|
||||||
|
name = "foo";
|
||||||
|
patch = ./foo.patch;
|
||||||
|
structuredExtraConfig.FOO = lib.kernel.yes;
|
||||||
|
features.foo = true;
|
||||||
|
}
|
||||||
|
]
|
||||||
|
'';
|
||||||
|
description = lib.mdDoc ''
|
||||||
|
A list of additional patches to apply to the kernel.
|
||||||
|
|
||||||
|
Every item should be an attribute set with the following attributes:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
{
|
||||||
|
name = "foo"; # descriptive name, required
|
||||||
|
|
||||||
|
patch = ./foo.patch; # path or derivation that contains the patch source
|
||||||
|
# (required, but can be null if only config changes
|
||||||
|
# are needed)
|
||||||
|
|
||||||
|
structuredExtraConfig = { # attrset of extra configuration parameters
|
||||||
|
FOO = lib.kernel.yes; # (without the CONFIG_ prefix, optional)
|
||||||
|
}; # values should generally be lib.kernel.yes or lib.kernel.no
|
||||||
|
|
||||||
|
features = { # attrset of extra "features" the kernel is considered to have
|
||||||
|
foo = true; # (may be checked by other NixOS modules, optional)
|
||||||
|
};
|
||||||
|
|
||||||
|
extraConfig = "CONFIG_FOO y"; # extra configuration options in string form
|
||||||
|
# (deprecated, use structuredExtraConfig instead, optional)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
There's a small set of existing kernel patches in Nixpkgs, available as `pkgs.kernelPatches`,
|
||||||
|
that follow this format and can be used directly.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
boot.kernel.randstructSeed = mkOption {
|
boot.kernel.randstructSeed = mkOption {
|
||||||
|
|
Loading…
Reference in a new issue