From adba92b5ef37e2fb873c29a07d7760119c8701b7 Mon Sep 17 00:00:00 2001 From: Linus Heckemann Date: Tue, 7 Aug 2018 09:00:52 +0200 Subject: systemd: improve unit script drv naming Also store scripts directly in the nix store rather than having the superfluous /bin/ tree. --- nixos/modules/system/boot/systemd.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index 951da797fe5..2d3d80a91bc 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -189,9 +189,8 @@ let ]; makeJobScript = name: text: - let mkScriptName = s: (replaceChars [ "\\" ] [ "-" ] (shellEscape s) ); - x = pkgs.writeTextFile { name = "unit-script"; executable = true; destination = "/bin/${mkScriptName name}"; inherit text; }; - in "${x}/bin/${mkScriptName name}"; + let mkScriptName = s: "unit-script-" + (replaceChars [ "\\" "@" ] [ "-" "_" ] (shellEscape s) ); + in pkgs.writeTextFile { name = mkScriptName name; executable = true; inherit text; }; unitConfig = { config, ... }: { config = { -- cgit 1.4.1