summary refs log tree commit diff
path: root/nixos/modules/system
diff options
context:
space:
mode:
authorLinus Heckemann <git@sphalerite.org>2021-03-08 21:34:59 +0100
committerGitHub <noreply@github.com>2021-03-08 21:34:59 +0100
commitc762b1eaab5c0ea237faf775c2c382f8508b8018 (patch)
treea0ad66aea1a73024ebd330ec27fbf0f699da9625 /nixos/modules/system
parent9e76aa2cca8b21f2dad37d1e18573248104938a8 (diff)
parentd81067f3f3c1c82231eeca2b0e69b89d544ea028 (diff)
downloadnixpkgs-c762b1eaab5c0ea237faf775c2c382f8508b8018.tar
nixpkgs-c762b1eaab5c0ea237faf775c2c382f8508b8018.tar.gz
nixpkgs-c762b1eaab5c0ea237faf775c2c382f8508b8018.tar.bz2
nixpkgs-c762b1eaab5c0ea237faf775c2c382f8508b8018.tar.lz
nixpkgs-c762b1eaab5c0ea237faf775c2c382f8508b8018.tar.xz
nixpkgs-c762b1eaab5c0ea237faf775c2c382f8508b8018.tar.zst
nixpkgs-c762b1eaab5c0ea237faf775c2c382f8508b8018.zip
Merge pull request #90065 from wizeman/u/fix-config-merge
linux: make sure all config options have the same value
Diffstat (limited to 'nixos/modules/system')
-rw-r--r--nixos/modules/system/boot/kernel_config.nix22
1 files changed, 1 insertions, 21 deletions
diff --git a/nixos/modules/system/boot/kernel_config.nix b/nixos/modules/system/boot/kernel_config.nix
index 783685c9dfe..5d9534024b0 100644
--- a/nixos/modules/system/boot/kernel_config.nix
+++ b/nixos/modules/system/boot/kernel_config.nix
@@ -2,24 +2,6 @@
 
 with lib;
 let
-  findWinner = candidates: winner:
-    any (x: x == winner) candidates;
-
-  # winners is an ordered list where first item wins over 2nd etc
-  mergeAnswer = winners: locs: defs:
-    let
-      values = map (x: x.value) defs;
-      inter = intersectLists values winners;
-      winner = head winners;
-    in
-    if defs == [] then abort "This case should never happen."
-    else if winner == [] then abort "Give a valid list of winner"
-    else if inter == [] then mergeOneOption locs defs
-    else if findWinner values winner then
-      winner
-    else
-      mergeAnswer (tail winners) locs defs;
-
   mergeFalseByDefault = locs: defs:
     if defs == [] then abort "This case should never happen."
     else if any (x: x == false) (getValues defs) then false
@@ -28,9 +10,7 @@ let
   kernelItem = types.submodule {
     options = {
       tristate = mkOption {
-        type = types.enum [ "y" "m" "n" null ] // {
-          merge = mergeAnswer [ "y" "m" "n" ];
-        };
+        type = types.enum [ "y" "m" "n" null ];
         default = null;
         internal = true;
         visible = true;