Compare commits

..

11 commits

Author SHA1 Message Date
4d6e7140ef fixup! nixos: services: servarr: fix 'enableAll' logic
Some checks failed
ci/woodpecker/push/check Pipeline failed
2025-03-31 15:30:54 +00:00
f312c80e55 nixos: services: servarr: nzbhydra: fix websockets
Some checks failed
ci/woodpecker/push/check Pipeline failed
From what I could read, NZBHydra2 *might* require proxying websockets in
new versions (better safe than sorry).
2025-03-31 14:09:22 +00:00
b19d5bf218 nixos: services: servarr: migrate nzbhydra 2025-03-31 11:44:50 +00:00
495098aa4c nixos: services: servarr: jackett: add 'port' 2025-03-31 11:28:04 +00:00
51cbbb0b7b nixos: services: servarr: migrate jackett 2025-03-31 11:27:18 +00:00
1a08118ced nixos: services: servarr: migrate prowlarr
Some checks failed
ci/woodpecker/push/check Pipeline failed
It's configured in the exact same way as other *arr apps, and thus
automatically gains the declarative port configuration now.

I also want to move the other two indexer modules under `servarr`, as
they are all closely related.
2025-03-31 11:22:52 +00:00
ad5cbd23c1 nixos: services: servarr: starr: add 'port'
Some checks failed
ci/woodpecker/push/check Pipeline failed
Now that declarative configurations are supported for those
applications.
2025-03-31 11:16:36 +00:00
d978787598 nixox: services: servarr: refactor starr config
Makes it slightly DRY-er and more readable.
2025-03-31 11:10:57 +00:00
cb294ea0d0 nixos: services: servarr: bazarr: add 'port' 2025-03-31 11:10:50 +00:00
2875f6dd5c nixos: services: servarr: extract bazarr
It's not an actual *arr package, but closely related to them. Extract
its configuration to a sub-module.
2025-03-31 11:10:21 +00:00
263b6c9a80 nixos: services: servarr: fix 'enableAll' logic
I renamed the option and refactored how it worked to make it more
explicit that it enables the entire suite by default, with explicit
opt-out of individual components (or fine-grained opt-in as an
alternative).
2025-03-31 11:02:45 +00:00
7 changed files with 11 additions and 63 deletions

12
flake.lock generated
View file

@ -136,11 +136,11 @@
]
},
"locked": {
"lastModified": 1743438213,
"narHash": "sha256-ZZDN+0v1r4I1xkQWlt8euOJv5S4EvElUCZMrDjTCEsY=",
"lastModified": 1742771635,
"narHash": "sha256-HQHzQPrg+g22tb3/K/4tgJjPzM+/5jbaujCZd8s2Mls=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "ccd7df836e1f42ea84806760f25b77b586370259",
"rev": "ad0614a1ec9cce3b13169e20ceb7e55dfaf2a818",
"type": "github"
},
"original": {
@ -152,11 +152,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1743315132,
"narHash": "sha256-6hl6L/tRnwubHcA4pfUUtk542wn2Om+D4UnDhlDW9BE=",
"lastModified": 1742669843,
"narHash": "sha256-G5n+FOXLXcRx+3hCJ6Rt6ZQyF1zqQ0DL0sWAMn2Nk0w=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "52faf482a3889b7619003c0daec593a1912fddc1",
"rev": "1e5b653dff12029333a6546c11e108ede13052eb",
"type": "github"
},
"original": {

View file

@ -3,7 +3,7 @@ let
cfg = config.my.services.servarr.bazarr;
in
{
options.my.services.servarr.bazarr = with lib; {
options.my.services.servarr = with lib; {
enable = lib.mkEnableOption "Bazarr" // {
default = config.my.services.servarr.enableAll;
};

View file

@ -8,8 +8,8 @@
./bazarr.nix
./jackett.nix
./nzbhydra.nix
./prowlarr.nix
(import ./starr.nix "lidarr")
(import ./starr.nix "prowlarr")
(import ./starr.nix "radarr")
(import ./starr.nix "readarr")
(import ./starr.nix "sonarr")

View file

@ -3,7 +3,7 @@ let
cfg = config.my.services.servarr.jackett;
in
{
options.my.services.servarr.jackett = with lib; {
options.my.services.servarr = with lib; {
enable = lib.mkEnableOption "Jackett" // {
default = config.my.services.servarr.enableAll;
};

View file

@ -3,7 +3,7 @@ let
cfg = config.my.services.servarr.nzbhydra;
in
{
options.my.services.servarr.nzbhydra = with lib; {
options.my.services.servarr = with lib; {
enable = lib.mkEnableOption "NZBHydra2" // {
default = config.my.services.servarr.enableAll;
};

View file

@ -1,53 +0,0 @@
# Torrent and NZB indexer
{ config, lib, ... }:
let
cfg = config.my.services.servarr.prowlarr;
in
{
options.my.services.servarr.prowlarr = with lib; {
enable = lib.mkEnableOption "Prowlarr" // {
default = config.my.services.servarr.enableAll;
};
port = mkOption {
type = types.port;
default = 9696;
example = 8080;
description = "Internal port for webui";
};
};
config = lib.mkIf cfg.enable {
services.prowlarr = {
enable = true;
settings = {
server = {
port = cfg.port;
};
};
};
my.services.nginx.virtualHosts = {
prowlarr = {
inherit (cfg) port;
};
};
services.fail2ban.jails = {
prowlarr = ''
enabled = true
filter = prowlarr
action = iptables-allports
'';
};
environment.etc = {
"fail2ban/filter.d/prowlarr.conf".text = ''
[Definition]
failregex = ^.*\|Warn\|Auth\|Auth-Failure ip <HOST> username .*$
journalmatch = _SYSTEMD_UNIT=prowlarr.service
'';
};
};
}

View file

@ -5,6 +5,7 @@ let
cfg = config.my.services.servarr.${starr};
ports = {
lidarr = 8686;
prowlarr = 9696;
radarr = 7878;
readarr = 8787;
sonarr = 8989;