From dda93320d8ec82fb74200e5745845d5fa88df144 Mon Sep 17 00:00:00 2001 From: rope Date: Mon, 4 May 2026 02:29:10 -0700 Subject: [PATCH] Update services/sabnzbd.nix --- services/sabnzbd.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/sabnzbd.nix b/services/sabnzbd.nix index 6b38cc5..9a32c4b 100644 --- a/services/sabnzbd.nix +++ b/services/sabnzbd.nix @@ -3,10 +3,12 @@ let patchConfig = pkgs.writeShellScript "sabnzbd-patch-config" '' CONFIG=/var/lib/sabnzbd/sabnzbd.ini HOSTNAME=sabnzbd.nordhammer.it + if [ ! -f "$CONFIG" ]; then printf '[misc]\nhost_whitelist = %s\nport = 8085\n' "$HOSTNAME" > "$CONFIG" exit 0 fi + ${pkgs.python3}/bin/python3 - <<'EOF' import configparser, os, sys config_file = '/var/lib/sabnzbd/sabnzbd.ini' @@ -27,10 +29,12 @@ EOF in { config = lib.mkIf (config.networking.hostName == "FredOS-Mediaserver") { + users.users.sabnzbd = { isSystemUser = true; group = "media"; }; + systemd.tmpfiles.rules = [ "d /var/lib/sabnzbd 0755 sabnzbd media -" "Z /var/lib/sabnzbd 0755 sabnzbd media -" @@ -39,6 +43,7 @@ in "d /mnt/storage/usenet/incomplete 2775 sabnzbd media -" "Z /mnt/storage/usenet/incomplete 2775 sabnzbd media -" ]; + systemd.services.sabnzbd = { description = "SABnzbd usenet downloader"; after = [ "network.target" ];