Skip to content

Commit 5676121

Browse files
committed
can specify the user for the service
1 parent d016f03 commit 5676121

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

nix/misc.nix

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ in
3333
} --disable-optimization --repl-options=-fobject-code --repl-options=-fno-break-on-exception --repl-options=-fno-break-on-error --repl-options=-v1 --repl-options=-ferror-spans --repl-options=-j -fghcid")
3434
'';
3535
};
36-
mkService = srv: exe: {
36+
mkService = srv: usr: exe: {
3737
lib,
3838
pkgs,
3939
config,
@@ -57,7 +57,10 @@ in
5757
wants = ["network.target"];
5858
wantedBy = ["default.target"];
5959
script = "PATH=$PATH:${pkgs.busybox}/bin ${exe}";
60-
serviceConfig.Restart = "on-failure";
60+
serviceConfig = {
61+
User = usr;
62+
Restart = "on-failure";
63+
};
6164
};
6265
};
6366
};

0 commit comments

Comments
 (0)