diff options
author | Matthieu Coudron <mattator@gmail.com> | 2020-04-01 03:20:33 +0200 |
---|---|---|
committer | Matthieu Coudron <mattator@gmail.com> | 2020-04-01 22:25:57 +0200 |
commit | b9a4e6953d0234cde64ac0cc55136adb3e92794b (patch) | |
tree | c0dfa75d9143bed36fca600b18b663efca864c87 /nixos/modules/system/boot | |
parent | ae6bdcc53584aaf20211ce1814bea97ece08a248 (diff) | |
download | nixlib-b9a4e6953d0234cde64ac0cc55136adb3e92794b.tar nixlib-b9a4e6953d0234cde64ac0cc55136adb3e92794b.tar.gz nixlib-b9a4e6953d0234cde64ac0cc55136adb3e92794b.tar.bz2 nixlib-b9a4e6953d0234cde64ac0cc55136adb3e92794b.tar.lz nixlib-b9a4e6953d0234cde64ac0cc55136adb3e92794b.tar.xz nixlib-b9a4e6953d0234cde64ac0cc55136adb3e92794b.tar.zst nixlib-b9a4e6953d0234cde64ac0cc55136adb3e92794b.zip |
kernel: fix config generation
Addresses https://github.com/NixOS/nixpkgs/issues/71803: Kernel options are not merged as described, especially the "optional" aspects. The error silences legitimate warnings.
Diffstat (limited to 'nixos/modules/system/boot')
-rw-r--r-- | nixos/modules/system/boot/kernel_config.nix | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/nixos/modules/system/boot/kernel_config.nix b/nixos/modules/system/boot/kernel_config.nix index a316782dfc57..85bd420e3044 100644 --- a/nixos/modules/system/boot/kernel_config.nix +++ b/nixos/modules/system/boot/kernel_config.nix @@ -22,7 +22,7 @@ let mergeFalseByDefault = locs: defs: if defs == [] then abort "This case should never happen." - else if any (x: x == false) defs then false + else if any (x: x == false) (getValues defs) then false else true; kernelItem = types.submodule { @@ -55,6 +55,7 @@ let default = false; description = '' Wether option should generate a failure when unused. + Upon merging values, mandatory wins over optional. ''; }; }; @@ -121,7 +122,7 @@ in type = types.attrsOf kernelItem; example = literalExample '' with lib.kernel; { "9P_NET" = yes; - USB = optional yes; + USB = option yes; MMC_BLOCK_MINORS = freeform "32"; }''; description = '' |