nixos: services: servarr: add autobrr

This commit is contained in:
Bruno BELANYI 2025-02-13 22:59:51 +01:00
parent 3510264186
commit 215eb4c91a
3 changed files with 66 additions and 0 deletions

View file

@ -141,6 +141,9 @@ in
# The whole *arr software suite # The whole *arr software suite
servarr = { servarr = {
enableAll = true; enableAll = true;
autobrr = {
enable = false;
};
# ... But not Lidarr because I don't care for music that much # ... But not Lidarr because I don't care for music that much
lidarr = { lidarr = {
enable = false; enable = false;

View file

@ -0,0 +1,62 @@
# IRC-based
{ config, lib, ... }:
let
cfg = config.my.services.servarr.autobrr;
in
{
options.my.services.servarr.autobrr = with lib; {
enable = mkEnableOption "autobrr IRC announce tracker" // {
default = config.my.services.servarr.enableAll;
};
port = mkOption {
type = types.port;
default = 7474;
example = 8080;
description = "Internal port for webui";
};
sessionSecretFile = mkOption {
type = types.str;
example = "/run/secrets/autobrr-secret.txt";
description = ''
File containing the session secret.
'';
};
};
config = lib.mkIf cfg.enable {
services.autobrr = {
enable = true;
settings = {
inherit (cfg) port;
checkForUpdates = false;
};
secretFile = cfg.sessionSecretFile;
};
my.services.nginx.virtualHosts = {
autobrr = {
inherit (cfg) port;
};
};
services.fail2ban.jails = {
autobrr = ''
enabled = true
filter = autobrr
action = iptables-allports
'';
};
environment.etc = {
"fail2ban/filter.d/autobrr.conf".text = ''
[Definition]
failregex = ^.*Auth: invalid login \[.*\] from: <HOST>$
journalmatch = _SYSTEMD_UNIT=autobrr.service
'';
};
};
}

View file

@ -5,6 +5,7 @@
{ lib, ... }: { lib, ... }:
{ {
imports = [ imports = [
./autobrr.nix
./bazarr.nix ./bazarr.nix
./jackett.nix ./jackett.nix
./nzbhydra.nix ./nzbhydra.nix