summary refs log tree commit diff
diff options
context:
space:
mode:
author5aaee9 <7685264+5aaee9@users.noreply.github.com>2023-10-26 18:34:19 +0800
committer5aaee9 <7685264+5aaee9@users.noreply.github.com>2023-10-31 01:06:37 +0800
commitc1ae82f448b10b278dc77e02518775175b463a27 (patch)
treeeecf0c63fa00c7c029ab84a4fda834dae92d8578
parent998720bf94bd1a00b628e1a192bbe297adf2f3d6 (diff)
downloadnixpkgs-c1ae82f448b10b278dc77e02518775175b463a27.tar
nixpkgs-c1ae82f448b10b278dc77e02518775175b463a27.tar.gz
nixpkgs-c1ae82f448b10b278dc77e02518775175b463a27.tar.bz2
nixpkgs-c1ae82f448b10b278dc77e02518775175b463a27.tar.lz
nixpkgs-c1ae82f448b10b278dc77e02518775175b463a27.tar.xz
nixpkgs-c1ae82f448b10b278dc77e02518775175b463a27.tar.zst
nixpkgs-c1ae82f448b10b278dc77e02518775175b463a27.zip
nixos/systemd: fix make unit failed when unit too large
-rw-r--r--nixos/lib/systemd-lib.nix3
1 files changed, 2 insertions, 1 deletions
diff --git a/nixos/lib/systemd-lib.nix b/nixos/lib/systemd-lib.nix
index 5669aae0bc1..fc95ab01289 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"