nixos/services/radarr.nix
ediblerope 984f45e1d4 Set UMask 0002 on all media services for group-writable files
Sonarr, Radarr, qBittorrent, Jellyfin, and Bazarr all need to create
files that are writable by the media group. Without this, Jellyfin
can't write thumbnails/artwork to media directories and services
can't collaborate on shared files. Also fixes radarr movies directory
to use setgid (2775) consistently.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-15 23:23:56 +01:00

33 lines
926 B
Nix

# services/radarr.nix
{ config, pkgs, lib, ... }:
{
config = lib.mkIf (config.networking.hostName == "FredOS-Mediaserver") {
# Radarr
services.radarr = {
enable = true;
openFirewall = true; # Opens port 7878
dataDir = "/var/lib/radarr";
user = "radarr";
group = "media";
};
# Ensure files created by radarr are group-writable
systemd.services.radarr.serviceConfig.UMask = "0002";
# Media group is already created in qbittorrent-nox.nix
# Just make sure radarr is in it
users.users.radarr = {
isSystemUser = true;
group = "media";
extraGroups = [ "media" ];
};
# Set up directory structure with proper permissions
systemd.tmpfiles.rules = [
# Media folders - radarr writes here
"d /mnt/storage/torrents/movies 2775 radarr media -"
"Z /mnt/storage/torrents/movies 2775 radarr media -"
];
};
}