Skip to content

Commit

Permalink
systemd-nspawn: fixes evaluation error
Browse files Browse the repository at this point in the history
fixes #25097

(cherry picked from commit 522c16b)
  • Loading branch information
Mic92 committed Jun 7, 2017
1 parent d3b66f9 commit 18e4687
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions nixos/modules/system/boot/systemd-nspawn.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ let
];

instanceOptions = {
options = {

options = sharedOptions // {
execConfig = mkOption {
default = {};
example = { Parameters = "/bin/sh"; };
Expand Down Expand Up @@ -82,18 +81,20 @@ let

};

instanceToUnit = name: def:
{ text = ''
[Exec]
${attrsToSection def.execConfig}
instanceToUnit = name: def:
let base = {
text = ''
[Exec]
${attrsToSection def.execConfig}
[Files]
${attrsToSection def.filesConfig}
[Files]
${attrsToSection def.filesConfig}
[Network]
${attrsToSection def.networkConfig}
'';
};
[Network]
${attrsToSection def.networkConfig}
'';
} // def;
in base // { unit = makeUnit name base; };

in {

Expand All @@ -109,7 +110,7 @@ in {

config =
let
units = mapAttrs' (n: v: nameValuePair "${n}.nspawn" (instanceToUnit n v)) cfg.instances;
units = mapAttrs' (n: v: nameValuePair "${n}.nspawn" (instanceToUnit n v)) cfg;
in mkIf (cfg != {}) {

environment.etc."systemd/nspawn".source = generateUnits "nspawn" units [] [];
Expand Down

0 comments on commit 18e4687

Please sign in to comment.