···411411 lambdabot = 191;
412412 #asterisk = 192; # unused
413413 plex = 193;
414414+ sabnzbd = 194;
414415415416 # When adding a gid, make sure it doesn't match an existing
416417 # uid. Users and groups with the same name should have equal
+28-12
nixos/modules/services/networking/sabnzbd.nix
···1717 services.sabnzbd = {
1818 enable = mkOption {
1919 default = false;
2020- description = "Whether to enable the sabnzbd FTP server.";
2020+ description = "Whether to enable the sabnzbd server.";
2121 };
2222 configFile = mkOption {
2323- default = "/var/sabnzbd/sabnzbd.ini";
2424- description = "Path to config file. (You need to create this file yourself!)";
2323+ default = "/var/lib/sabnzbd/sabnzbd.ini";
2424+ description = "Path to config file.";
2525+ };
2626+2727+ user = mkOption {
2828+ default = "sabnzbd";
2929+ description = "User to run the service as";
3030+ };
3131+3232+ group = mkOption {
3333+ default = "sabnzbd";
3434+ description = "Group to run the service as";
2535 };
2636 };
2737 };
···31413242 config = mkIf cfg.enable {
33433434- users.extraUsers =
3535- [ { name = "sabnzbd";
4444+ users.extraUsers.sabnzbd = {
3645 uid = config.ids.uids.sabnzbd;
4646+ group = "sabnzbd";
3747 description = "sabnzbd user";
3838- home = "/homeless-shelter";
3939- }
4040- ];
4848+ home = "/var/lib/sabnzbd/";
4949+ createHome = true;
5050+ };
41514242- systemd.services.sabnzbd =
4343- { description = "sabnzbd server";
5252+ users.extraGroups.sabnzbd = {
5353+ gid = config.ids.gids.sabnzbd;
5454+ };
5555+5656+ systemd.services.sabnzbd = {
5757+ description = "sabnzbd server";
4458 wantedBy = [ "multi-user.target" ];
4559 after = [ "network.target" ];
4660 serviceConfig = {
4761 Type = "forking";
6262+ GuessMainPID = "no";
6363+ User = "${cfg.user}";
6464+ Group = "${cfg.group}";
4865 ExecStart = "${sabnzbd}/bin/sabnzbd -d -f ${cfg.configFile}";
4966 };
5050- };
5151-6767+ };
5268 };
5369}