Unverified Commit 9b41185d authored by K900's avatar K900 Committed by GitHub
Browse files

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

nixos/kernel: better docs for boot.kernelPatches
parents 8822a087 cd1c574e
Loading
Loading
Loading
Loading
+39 −2
Original line number Diff line number Diff line
@@ -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 {