nixos/containers: give a name to an anonymous container module
See https://github.com/NixOS/nixpkgs/issues/15747. Previously this module was called `<unknown-file>` in error messages, now it is called a bit more close to real: ``` module at /home/danbst/dev/nixpkgs/nixos/modules/virtualisation/containers.nix:470 ```
This commit is contained in:
parent
bfb6ef1d59
commit
f7940bb95d
|
@ -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