Skip to content

Commit

Permalink
systemd: fix creation of user service unit files
Browse files Browse the repository at this point in the history
  • Loading branch information
andresilva committed Apr 6, 2022
1 parent a90ddcd commit ec7e0fb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions modules/systemd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,14 @@ let

# Needed because systemd derives unit names from the ultimate
# link target.
source = pkgs.writeTextFile {
name = pathSafeName;
source = (pkgs.runCommand "unit-${pathSafeName}" {
preferLocalBuild = true;
allowSubstitutes = false;
text = toSystemdIni serviceCfg;
destination = lib.escapeShellArg "/${filename}";
} + "/${filename}";
} ''
mkdir -p $out
echo -n "$text" > $out/${lib.escapeShellArg filename}
'') + "/${filename}";

wantedBy = target: {
name = "systemd/user/${target}.wants/${filename}";
Expand Down

0 comments on commit ec7e0fb

Please sign in to comment.