Merge pull request #52852 from jokogr/f/syncthing-service
syncthing: Fix systemd service
This commit is contained in:
commit
08870eeee9
@ -122,7 +122,7 @@ in {
|
||||
|
||||
systemd.packages = [ pkgs.syncthing ];
|
||||
|
||||
users = mkIf (cfg.user == defaultUser) {
|
||||
users = mkIf (cfg.systemService && cfg.user == defaultUser) {
|
||||
users."${defaultUser}" =
|
||||
{ group = cfg.group;
|
||||
home = cfg.dataDir;
|
||||
|
@ -63,19 +63,19 @@ in {
|
||||
done
|
||||
|
||||
'' + lib.optionalString (stdenv.isLinux) ''
|
||||
mkdir -p $out/lib/systemd/{system,user}
|
||||
mkdir -p $bin/lib/systemd/{system,user}
|
||||
|
||||
substitute etc/linux-systemd/system/syncthing-resume.service \
|
||||
$out/lib/systemd/system/syncthing-resume.service \
|
||||
$bin/lib/systemd/system/syncthing-resume.service \
|
||||
--replace /usr/bin/pkill ${procps}/bin/pkill
|
||||
|
||||
substitute etc/linux-systemd/system/syncthing@.service \
|
||||
$out/lib/systemd/system/syncthing@.service \
|
||||
--replace /usr/bin/syncthing $out/bin/syncthing
|
||||
$bin/lib/systemd/system/syncthing@.service \
|
||||
--replace /usr/bin/syncthing $bin/bin/syncthing
|
||||
|
||||
substitute etc/linux-systemd/user/syncthing.service \
|
||||
$out/lib/systemd/user/syncthing.service \
|
||||
--replace /usr/bin/syncthing $out/bin/syncthing
|
||||
$bin/lib/systemd/user/syncthing.service \
|
||||
--replace /usr/bin/syncthing $bin/bin/syncthing
|
||||
'';
|
||||
};
|
||||
|
||||
@ -99,7 +99,7 @@ in {
|
||||
|
||||
substitute cmd/strelaysrv/etc/linux-systemd/strelaysrv.service \
|
||||
$out/lib/systemd/system/strelaysrv.service \
|
||||
--replace /usr/bin/strelaysrv $out/bin/strelaysrv
|
||||
--replace /usr/bin/strelaysrv $bin/bin/strelaysrv
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user