From c1ae82f448b10b278dc77e02518775175b463a27 Mon Sep 17 00:00:00 2001 From: 5aaee9 <7685264+5aaee9@users.noreply.github.com> Date: Thu, 26 Oct 2023 18:34:19 +0800 Subject: [PATCH] nixos/systemd: fix make unit failed when unit too large --- nixos/lib/systemd-lib.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nixos/lib/systemd-lib.nix b/nixos/lib/systemd-lib.nix index 5669aae0bc19..fc95ab01289f 100644 --- a/nixos/lib/systemd-lib.nix +++ b/nixos/lib/systemd-lib.nix @@ -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"