nixos/services/sonarr.nix
ediblerope 2e29d3dce5 Force UMask=0002 on Radarr, Sonarr, Bazarr
New nixpkgs defaults for the *arr services set UMask=0022, which
conflicts with the media-group-writable overrides. Wrap with
lib.mkForce alongside the existing Jellyfin fix.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 20:22:37 +01:00

32 lines
862 B
Nix

# sonarr.nix
{ config, pkgs, lib, ... }:
{
config = lib.mkIf (config.networking.hostName == "FredOS-Mediaserver") {
# Sonarr
services.sonarr = {
enable = true;
openFirewall = true;
dataDir = "/var/lib/sonarr";
user = "sonarr";
group = "media";
};
# Ensure files created by sonarr are group-writable
systemd.services.sonarr.serviceConfig.UMask = lib.mkForce "0002";
# Media group is already created in qbittorrent-nox.nix
# Just make sure sonarr is in it
users.users.sonarr = {
isSystemUser = true;
group = "media";
extraGroups = [ "media" ];
};
systemd.tmpfiles.rules = [
# Shows - sonarr organises, bazarr writes subtitles
"d /mnt/storage/torrents/shows 2775 sonarr media -"
"Z /mnt/storage/torrents/shows 2775 sonarr media -"
];
};
}