Merge pull request #263555 from 5aaee9/master

nixos/systemd: fix make unit failed when unit too large
This commit is contained in:
Emily 2023-10-31 16:08:29 +01:00 committed by GitHub
commit 4a644c17c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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