Merge pull request #197376 from ck3d/fix-nspawn-generator
nixos/unitGenerator: fix generation for nspawn files
This commit is contained in:
commit
92ab8de4d4
2 changed files with 6 additions and 3 deletions
|
@ -214,7 +214,7 @@ in rec {
|
||||||
${concatStrings (mapAttrsToList (name: unit:
|
${concatStrings (mapAttrsToList (name: unit:
|
||||||
concatMapStrings (name2: ''
|
concatMapStrings (name2: ''
|
||||||
ln -sfn '${name}' $out/'${name2}'
|
ln -sfn '${name}' $out/'${name2}'
|
||||||
'') unit.aliases) units)}
|
'') (unit.aliases or [])) units)}
|
||||||
|
|
||||||
# Create .wants and .requires symlinks from the wantedBy and
|
# Create .wants and .requires symlinks from the wantedBy and
|
||||||
# requiredBy options.
|
# requiredBy options.
|
||||||
|
@ -222,13 +222,13 @@ in rec {
|
||||||
concatMapStrings (name2: ''
|
concatMapStrings (name2: ''
|
||||||
mkdir -p $out/'${name2}.wants'
|
mkdir -p $out/'${name2}.wants'
|
||||||
ln -sfn '../${name}' $out/'${name2}.wants'/
|
ln -sfn '../${name}' $out/'${name2}.wants'/
|
||||||
'') unit.wantedBy) units)}
|
'') (unit.wantedBy or [])) units)}
|
||||||
|
|
||||||
${concatStrings (mapAttrsToList (name: unit:
|
${concatStrings (mapAttrsToList (name: unit:
|
||||||
concatMapStrings (name2: ''
|
concatMapStrings (name2: ''
|
||||||
mkdir -p $out/'${name2}.requires'
|
mkdir -p $out/'${name2}.requires'
|
||||||
ln -sfn '../${name}' $out/'${name2}.requires'/
|
ln -sfn '../${name}' $out/'${name2}.requires'/
|
||||||
'') unit.requiredBy) units)}
|
'') (unit.requiredBy or [])) units)}
|
||||||
|
|
||||||
${optionalString (type == "system") ''
|
${optionalString (type == "system") ''
|
||||||
# Stupid misc. symlinks.
|
# Stupid misc. symlinks.
|
||||||
|
|
|
@ -41,6 +41,9 @@ import ./make-test-python.nix ({ pkgs, ... }:
|
||||||
systemd.targets.machines.wants = [ "systemd-nspawn@${containerName}.service" ];
|
systemd.targets.machines.wants = [ "systemd-nspawn@${containerName}.service" ];
|
||||||
|
|
||||||
virtualisation.additionalPaths = [ containerSystem ];
|
virtualisation.additionalPaths = [ containerSystem ];
|
||||||
|
|
||||||
|
# not needed, but we want to test the nspawn file generation
|
||||||
|
systemd.nspawn.${containerName} = { };
|
||||||
};
|
};
|
||||||
|
|
||||||
testScript = ''
|
testScript = ''
|
||||||
|
|
Loading…
Reference in a new issue