Merge pull request #210091 from K900/better-kernel-docs

nixos/kernel: better docs for boot.kernelPatches
This commit is contained in:
K900 2023-01-11 00:38:01 +03:00 committed by GitHub
commit 9b41185df8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -73,8 +73,45 @@ in
boot.kernelPatches = mkOption {
type = types.listOf types.attrs;
default = [];
example = literalExpression "[ pkgs.kernelPatches.ubuntu_fan_4_4 ]";
description = lib.mdDoc "A list of additional patches to apply to the kernel.";
example = literalExpression ''
[
{
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 {