mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 15:11:25 +00:00
systemd: replace @ when generating unit command name
This commit is contained in:
parent
6a703aa570
commit
2fa662c957
@ -10,15 +10,19 @@ let
|
||||
|
||||
systemd = cfg.package;
|
||||
|
||||
|
||||
makeUnit = name: unit:
|
||||
let
|
||||
pathSafeName = lib.replaceChars ["@"] ["-"] name;
|
||||
in
|
||||
if unit.enable then
|
||||
pkgs.runCommand "unit-${name}" { preferLocalBuild = true; inherit (unit) text; }
|
||||
pkgs.runCommand "unit-${pathSafeName}" { preferLocalBuild = true; inherit (unit) text; }
|
||||
''
|
||||
mkdir -p $out
|
||||
echo -n "$text" > $out/${shellEscape name}
|
||||
''
|
||||
else
|
||||
pkgs.runCommand "unit-${name}-disabled" { preferLocalBuild = true; }
|
||||
pkgs.runCommand "unit-${pathSafeName}-disabled" { preferLocalBuild = true; }
|
||||
''
|
||||
mkdir -p $out
|
||||
ln -s /dev/null $out/${shellEscape name}
|
||||
|
Loading…
Reference in New Issue
Block a user