From 8691ab3d47f1f9f94b51357fba7b8133cc8bcd88 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Mon, 24 Jan 2022 16:23:18 +0100 Subject: [PATCH] lib.modules: Define mergeOneOption in terms of mergeUniqueOption --- lib/options.nix | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/options.nix b/lib/options.nix index 44ec335545ca..ffe4b2651661 100644 --- a/lib/options.nix +++ b/lib/options.nix @@ -128,11 +128,7 @@ rec { else if all isInt list && all (x: x == head list) list then head list else throw "Cannot merge definitions of `${showOption loc}'. Definition values:${showDefs defs}"; - mergeOneOption = loc: defs: - if defs == [] then abort "This case should never happen." - else if length defs != 1 then - throw "The unique option `${showOption loc}' is defined multiple times. Definition values:${showDefs defs}" - else (head defs).value; + mergeOneOption = mergeUniqueOption { message = ""; }; mergeUniqueOption = { message }: loc: defs: if length defs == 1