1 { config, pkgs, lib, ... }:
6 cfg = config.services.radarr;
12 enable = mkEnableOption (lib.mdDoc "Radarr");
15 description = lib.mdDoc "Radarr package to use";
16 default = pkgs.radarr;
17 defaultText = literalExpression "pkgs.radarr";
18 example = literalExpression "pkgs.radarr";
24 default = "/var/lib/radarr/.config/Radarr";
25 description = lib.mdDoc "The directory where Radarr stores its data files.";
28 openFirewall = mkOption {
31 description = lib.mdDoc "Open ports in the firewall for the Radarr web interface.";
37 description = lib.mdDoc "User account under which Radarr runs.";
43 description = lib.mdDoc "Group under which Radarr runs.";
48 config = mkIf cfg.enable {
49 systemd.tmpfiles.rules = [
50 "d '${cfg.dataDir}' 0700 ${cfg.user} ${cfg.group} - -"
53 systemd.services.radarr = {
54 description = "Radarr";
55 after = [ "network.target" ];
56 wantedBy = [ "multi-user.target" ];
62 ExecStart = "${cfg.package}/bin/Radarr -nobrowser -data='${cfg.dataDir}'";
63 Restart = "on-failure";
67 networking.firewall = mkIf cfg.openFirewall {
68 allowedTCPPorts = [ 7878 ];
71 users.users = mkIf (cfg.user == "radarr") {
75 uid = config.ids.uids.radarr;
79 users.groups = mkIf (cfg.group == "radarr") {
80 radarr.gid = config.ids.gids.radarr;