nixos: static ids for jackett, radarr, sonarr

This commit is contained in:
Edward Tjörnhammar 2017-04-22 09:44:12 +02:00
parent d25f7c9eed
commit 45470c65f5
No known key found for this signature in database
GPG Key ID: 7B82CE4A866B6845
4 changed files with 21 additions and 6 deletions

View File

@ -289,6 +289,9 @@
rpc = 271; rpc = 271;
geoip = 272; geoip = 272;
fcron = 273; fcron = 273;
sonarr = 274;
radarr = 275;
jackett = 276;
# When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399! # When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!
@ -547,6 +550,9 @@
#rpc = 271; # unused #rpc = 271; # unused
#geoip = 272; # unused #geoip = 272; # unused
fcron = 273; fcron = 273;
sonarr = 274;
radarr = 275;
jackett = 276;
# When adding a gid, make sure it doesn't match an existing # When adding a gid, make sure it doesn't match an existing
# uid. Users and groups with the same name should have equal # uid. Users and groups with the same name should have equal

View File

@ -22,14 +22,14 @@ in
echo "Creating jackett data directory in /var/lib/jackett/" echo "Creating jackett data directory in /var/lib/jackett/"
mkdir -p /var/lib/jackett/ mkdir -p /var/lib/jackett/
} }
chown -R jackett /var/lib/jackett/ chown -R jackett:jackett /var/lib/jackett/
chmod 0700 /var/lib/jackett/ chmod 0700 /var/lib/jackett/
''; '';
serviceConfig = { serviceConfig = {
Type = "simple"; Type = "simple";
User = "jackett"; User = "jackett";
Group = "nogroup"; Group = "jackett";
PermissionsStartOnly = "true"; PermissionsStartOnly = "true";
ExecStart = "${pkgs.jackett}/bin/Jackett"; ExecStart = "${pkgs.jackett}/bin/Jackett";
Restart = "on-failure"; Restart = "on-failure";
@ -37,8 +37,11 @@ in
}; };
users.extraUsers.jackett = { users.extraUsers.jackett = {
uid = config.ids.uids.jackett;
home = "/var/lib/jackett"; home = "/var/lib/jackett";
group = "jackett";
}; };
users.extraGroups.jackett.gid = config.ids.gids.jackett;
}; };
} }

View File

@ -22,14 +22,14 @@ in
echo "Creating radarr data directory in /var/lib/radarr/" echo "Creating radarr data directory in /var/lib/radarr/"
mkdir -p /var/lib/radarr/ mkdir -p /var/lib/radarr/
} }
chown -R radarr /var/lib/radarr/ chown -R radarr:radarr /var/lib/radarr/
chmod 0700 /var/lib/radarr/ chmod 0700 /var/lib/radarr/
''; '';
serviceConfig = { serviceConfig = {
Type = "simple"; Type = "simple";
User = "radarr"; User = "radarr";
Group = "nogroup"; Group = "radarr";
PermissionsStartOnly = "true"; PermissionsStartOnly = "true";
ExecStart = "${pkgs.radarr}/bin/Radarr"; ExecStart = "${pkgs.radarr}/bin/Radarr";
Restart = "on-failure"; Restart = "on-failure";
@ -37,8 +37,11 @@ in
}; };
users.extraUsers.radarr = { users.extraUsers.radarr = {
uid = config.ids.uids.radarr;
home = "/var/lib/radarr"; home = "/var/lib/radarr";
group = "radarr";
}; };
users.extraGroups.radarr.gid = config.ids.gids.radarr;
}; };
} }

View File

@ -22,14 +22,14 @@ in
echo "Creating sonarr data directory in /var/lib/sonarr/" echo "Creating sonarr data directory in /var/lib/sonarr/"
mkdir -p /var/lib/sonarr/ mkdir -p /var/lib/sonarr/
} }
chown -R sonarr /var/lib/sonarr/ chown -R sonarr:sonarr /var/lib/sonarr/
chmod 0700 /var/lib/sonarr/ chmod 0700 /var/lib/sonarr/
''; '';
serviceConfig = { serviceConfig = {
Type = "simple"; Type = "simple";
User = "sonarr"; User = "sonarr";
Group = "nogroup"; Group = "sonarr";
PermissionsStartOnly = "true"; PermissionsStartOnly = "true";
ExecStart = "${pkgs.sonarr}/bin/NzbDrone --no-browser"; ExecStart = "${pkgs.sonarr}/bin/NzbDrone --no-browser";
Restart = "on-failure"; Restart = "on-failure";
@ -37,8 +37,11 @@ in
}; };
users.extraUsers.sonarr = { users.extraUsers.sonarr = {
uid = config.ids.uids.sonarr;
home = "/var/lib/sonarr"; home = "/var/lib/sonarr";
group = "sonarr";
}; };
users.extraGroups.sonarr.gid = config.ids.gids.sonarr;
}; };
} }