syncthings: no need for systemService option
This commit is contained in:
parent
92b3d5c56e
commit
db3df565d5
|
@ -496,14 +496,6 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
systemService = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = true;
|
|
||||||
description = lib.mdDoc ''
|
|
||||||
Whether to auto-launch Syncthing as a system service.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
user = mkOption {
|
user = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = defaultUser;
|
default = defaultUser;
|
||||||
|
@ -622,7 +614,7 @@ in {
|
||||||
|
|
||||||
systemd.packages = [ pkgs.syncthing ];
|
systemd.packages = [ pkgs.syncthing ];
|
||||||
|
|
||||||
users.users = mkIf (cfg.systemService && cfg.user == defaultUser) {
|
users.users = mkIf (cfg.user == defaultUser) {
|
||||||
${defaultUser} =
|
${defaultUser} =
|
||||||
{ group = cfg.group;
|
{ group = cfg.group;
|
||||||
home = cfg.dataDir;
|
home = cfg.dataDir;
|
||||||
|
@ -632,7 +624,7 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
users.groups = mkIf (cfg.systemService && cfg.group == defaultGroup) {
|
users.groups = mkIf (cfg.group == defaultGroup) {
|
||||||
${defaultGroup}.gid =
|
${defaultGroup}.gid =
|
||||||
config.ids.gids.syncthing;
|
config.ids.gids.syncthing;
|
||||||
};
|
};
|
||||||
|
@ -640,7 +632,7 @@ in {
|
||||||
systemd.services = {
|
systemd.services = {
|
||||||
# upstream reference:
|
# upstream reference:
|
||||||
# https://github.com/syncthing/syncthing/blob/main/etc/linux-systemd/system/syncthing%40.service
|
# https://github.com/syncthing/syncthing/blob/main/etc/linux-systemd/system/syncthing%40.service
|
||||||
syncthing = mkIf cfg.systemService {
|
syncthing = {
|
||||||
description = "Syncthing service";
|
description = "Syncthing service";
|
||||||
after = [ "network.target" ];
|
after = [ "network.target" ];
|
||||||
environment = {
|
environment = {
|
||||||
|
|
Loading…
Reference in New Issue