systemd: improve unit script drv naming

Also store scripts directly in the nix store rather than having the
superfluous /bin/ tree.
This commit is contained in:
Linus Heckemann 2018-08-07 09:00:52 +02:00 committed by Robin Gloster
parent bfa01320ee
commit adba92b5ef

View file

@ -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 = {