nixos/systemd: fix make unit failed when unit too large

This commit is contained in:
5aaee9 2023-10-26 18:34:19 +08:00
parent 998720bf94
commit c1ae82f448

View File

@ -21,11 +21,12 @@ in rec {
{ preferLocalBuild = true; { preferLocalBuild = true;
allowSubstitutes = false; allowSubstitutes = false;
inherit (unit) text; inherit (unit) text;
passAsFile = [ "text" ];
} }
'' ''
name=${shellEscape name} name=${shellEscape name}
mkdir -p "$out/$(dirname -- "$name")" mkdir -p "$out/$(dirname -- "$name")"
echo -n "$text" > "$out/$name" mv "$textPath" "$out/$name"
'' ''
else else
pkgs.runCommand "unit-${mkPathSafeName name}-disabled" pkgs.runCommand "unit-${mkPathSafeName name}-disabled"