diff options
author | William A. Kennington III <william@wkennington.com> | 2015-05-07 01:44:49 -0700 |
---|---|---|
committer | William A. Kennington III <william@wkennington.com> | 2015-05-07 01:44:49 -0700 |
commit | 074c4a7f789449f6212b6e5c5ead26969809e534 (patch) | |
tree | f2deafc4e0ba5a95216fe1a09bb8cf2b87fbb25b /nixos/modules/services/networking | |
parent | d3f3317632f40b403afab3cc055c78ead00e93bd (diff) | |
parent | 10bb715c077ced71defbd4318cebe77b64b7a279 (diff) | |
download | nixlib-074c4a7f789449f6212b6e5c5ead26969809e534.tar nixlib-074c4a7f789449f6212b6e5c5ead26969809e534.tar.gz nixlib-074c4a7f789449f6212b6e5c5ead26969809e534.tar.bz2 nixlib-074c4a7f789449f6212b6e5c5ead26969809e534.tar.lz nixlib-074c4a7f789449f6212b6e5c5ead26969809e534.tar.xz nixlib-074c4a7f789449f6212b6e5c5ead26969809e534.tar.zst nixlib-074c4a7f789449f6212b6e5c5ead26969809e534.zip |
Merge remote-tracking branch 'upstream/master' into staging
Diffstat (limited to 'nixos/modules/services/networking')
-rw-r--r-- | nixos/modules/services/networking/sabnzbd.nix | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/nixos/modules/services/networking/sabnzbd.nix b/nixos/modules/services/networking/sabnzbd.nix index 77bf64b80d0f..cacf753fdcd7 100644 --- a/nixos/modules/services/networking/sabnzbd.nix +++ b/nixos/modules/services/networking/sabnzbd.nix @@ -17,11 +17,21 @@ in services.sabnzbd = { enable = mkOption { default = false; - description = "Whether to enable the sabnzbd FTP server."; + description = "Whether to enable the sabnzbd server."; }; configFile = mkOption { - default = "/var/sabnzbd/sabnzbd.ini"; - description = "Path to config file. (You need to create this file yourself!)"; + default = "/var/lib/sabnzbd/sabnzbd.ini"; + description = "Path to config file."; + }; + + user = mkOption { + default = "sabnzbd"; + description = "User to run the service as"; + }; + + group = mkOption { + default = "sabnzbd"; + description = "Group to run the service as"; }; }; }; @@ -31,23 +41,29 @@ in config = mkIf cfg.enable { - users.extraUsers = - [ { name = "sabnzbd"; + users.extraUsers.sabnzbd = { uid = config.ids.uids.sabnzbd; + group = "sabnzbd"; description = "sabnzbd user"; - home = "/homeless-shelter"; - } - ]; + home = "/var/lib/sabnzbd/"; + createHome = true; + }; - systemd.services.sabnzbd = - { description = "sabnzbd server"; + users.extraGroups.sabnzbd = { + gid = config.ids.gids.sabnzbd; + }; + + systemd.services.sabnzbd = { + description = "sabnzbd server"; wantedBy = [ "multi-user.target" ]; after = [ "network.target" ]; serviceConfig = { Type = "forking"; + GuessMainPID = "no"; + User = "${cfg.user}"; + Group = "${cfg.group}"; ExecStart = "${sabnzbd}/bin/sabnzbd -d -f ${cfg.configFile}"; }; - }; - + }; }; } |