about summary refs log tree commit diff
path: root/nixos/modules/system
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2020-05-22 13:32:22 +0200
committerGitHub <noreply@github.com>2020-05-22 13:32:22 +0200
commitcfb4d0dfe329fd5a20f74c4763ddfa3cf571192a (patch)
tree36b603fcf865967dede5ab7a4797cf068c668834 /nixos/modules/system
parent16d7f7edae6847e7a792d79b533b245f71907f46 (diff)
parentbc6b37e9678f3a095211764b8d4f8c12d8ea7d4e (diff)
downloadnixlib-cfb4d0dfe329fd5a20f74c4763ddfa3cf571192a.tar
nixlib-cfb4d0dfe329fd5a20f74c4763ddfa3cf571192a.tar.gz
nixlib-cfb4d0dfe329fd5a20f74c4763ddfa3cf571192a.tar.bz2
nixlib-cfb4d0dfe329fd5a20f74c4763ddfa3cf571192a.tar.lz
nixlib-cfb4d0dfe329fd5a20f74c4763ddfa3cf571192a.tar.xz
nixlib-cfb4d0dfe329fd5a20f74c4763ddfa3cf571192a.tar.zst
nixlib-cfb4d0dfe329fd5a20f74c4763ddfa3cf571192a.zip
Merge pull request #84032 from teto/fix_kernel_merge
Fix kernel configuration merge
Diffstat (limited to 'nixos/modules/system')
-rw-r--r--nixos/modules/system/boot/kernel_config.nix5
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 = ''