1 { config, pkgs, lib, ... }:
6 cfg = config.services.radarr;
12 enable = mkEnableOption "Radarr, a UsetNet/BitTorrent movie downloader";
14 package = mkPackageOption pkgs "radarr" { };
18 default = "/var/lib/radarr/.config/Radarr";
19 description = "The directory where Radarr stores its data files.";
22 openFirewall = mkOption {
25 description = "Open ports in the firewall for the Radarr web interface.";
31 description = "User account under which Radarr runs.";
37 description = "Group under which Radarr runs.";
42 config = mkIf cfg.enable {
43 systemd.tmpfiles.settings."10-radarr".${cfg.dataDir}.d = {
44 inherit (cfg) user group;
48 systemd.services.radarr = {
49 description = "Radarr";
50 after = [ "network.target" ];
51 wantedBy = [ "multi-user.target" ];
57 ExecStart = "${cfg.package}/bin/Radarr -nobrowser -data='${cfg.dataDir}'";
58 Restart = "on-failure";
62 networking.firewall = mkIf cfg.openFirewall {
63 allowedTCPPorts = [ 7878 ];
66 users.users = mkIf (cfg.user == "radarr") {
70 uid = config.ids.uids.radarr;
74 users.groups = mkIf (cfg.group == "radarr") {
75 radarr.gid = config.ids.gids.radarr;