Merge pull request #62712 from danbst/module-conflict-naming
NixOS module system: improve one of error messages
This commit is contained in:
commit
e718eb6243
@ -101,7 +101,7 @@ rec {
|
|||||||
mergeOneOption = loc: defs:
|
mergeOneOption = loc: defs:
|
||||||
if defs == [] then abort "This case should never happen."
|
if defs == [] then abort "This case should never happen."
|
||||||
else if length defs != 1 then
|
else if length defs != 1 then
|
||||||
throw "The unique option `${showOption loc}' is defined multiple times, in ${showFiles (getFiles defs)}."
|
throw "The unique option `${showOption loc}' is defined multiple times, in:\n - ${concatStringsSep "\n - " (getFiles defs)}."
|
||||||
else (head defs).value;
|
else (head defs).value;
|
||||||
|
|
||||||
/* "Merge" option definitions by checking that they all have the same value. */
|
/* "Merge" option definitions by checking that they all have the same value. */
|
||||||
|
@ -465,8 +465,11 @@ in
|
|||||||
merge = loc: defs: (import ../../lib/eval-config.nix {
|
merge = loc: defs: (import ../../lib/eval-config.nix {
|
||||||
inherit system;
|
inherit system;
|
||||||
modules =
|
modules =
|
||||||
let extraConfig =
|
let
|
||||||
{ boot.isContainer = true;
|
extraConfig = {
|
||||||
|
_file = "module at ${__curPos.file}:${toString __curPos.line}";
|
||||||
|
config = {
|
||||||
|
boot.isContainer = true;
|
||||||
networking.hostName = mkDefault name;
|
networking.hostName = mkDefault name;
|
||||||
networking.useDHCP = false;
|
networking.useDHCP = false;
|
||||||
assertions = [
|
assertions = [
|
||||||
@ -480,6 +483,7 @@ in
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
};
|
||||||
in [ extraConfig ] ++ (map (x: x.value) defs);
|
in [ extraConfig ] ++ (map (x: x.value) defs);
|
||||||
prefix = [ "containers" name ];
|
prefix = [ "containers" name ];
|
||||||
}).config;
|
}).config;
|
||||||
|
Loading…
Reference in New Issue
Block a user