wip: setting up download clients in the arr stack
Some checks failed
Test action / kaas (push) Failing after 0s

This commit is contained in:
Chris Kruining 2025-12-09 16:18:09 +01:00
parent 6af9101a13
commit 4624b0b0f7
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
2 changed files with 47 additions and 27 deletions

View file

@ -106,25 +106,5 @@ in {
}; };
systemd.services.jellyfin.serviceConfig.killSignal = lib.mkForce "SIGKILL"; systemd.services.jellyfin.serviceConfig.killSignal = lib.mkForce "SIGKILL";
sops = {
secrets = {
# "qbittorrent/password" = {};
"qbittorrent/password_hash" = {};
};
templates = {
"qbittorrent/password.conf" = {
owner = cfg.user;
group = cfg.group;
restartUnits = ["qbittorrent.service"];
path = "${config.services.qbittorrent.profileDir}/qBittorrent/config/password.conf";
content = ''
[Preferences]
WebUI\Password_PBKDF2="${config.sops.placeholder."qbittorrent/password_hash"}"
'';
};
};
};
}; };
} }

View file

@ -72,10 +72,8 @@ in {
group = "media"; group = "media";
}); });
})) }))
|> lib.mkMerge |> lib.concat [
|> (set: {
set
// {
qbittorrent = { qbittorrent = {
enable = true; enable = true;
openFirewall = true; openFirewall = true;
@ -86,6 +84,7 @@ in {
Prefecences.WebUI = { Prefecences.WebUI = {
Username = "admin"; Username = "admin";
Password_PBKDF2 = "@ByteArray(JpfX3wSUcMolUFD+8AD67w==:fr5kmc6sK9xsCfGW6HkPX2K1lPYHL6g2ncLLwuOVmjphmxkwBJ8pi/XQDsDWzyM/MRh5zPhUld2Xqn8o7BWv3Q==)";
}; };
}; };
@ -97,7 +96,7 @@ in {
sabnzbd = { sabnzbd = {
enable = true; enable = true;
openFirewall = true; openFirewall = true;
configFile = "${cfg.path}/sabnzbd/config.ini"; configFile = config.sops.templates."sabnzbd/config.ini".path;
user = "sabnzbd"; user = "sabnzbd";
group = "media"; group = "media";
@ -113,7 +112,9 @@ in {
ensureDBOwnership = true; ensureDBOwnership = true;
}); });
}; };
}); }
]
|> lib.mkMerge;
systemd.services = systemd.services =
cfg cfg
@ -125,6 +126,8 @@ in {
... ...
}: (mkIf enable { }: (mkIf enable {
"${service}ApplyTerraform" = let "${service}ApplyTerraform" = let
config' = config;
terraformConfiguration = inputs.terranix.lib.terranixConfiguration { terraformConfiguration = inputs.terranix.lib.terranixConfiguration {
inherit system; inherit system;
@ -168,6 +171,30 @@ in {
|> lib.imap (i: f: lib.nameValuePair "local${toString i}" {path = f;}) |> lib.imap (i: f: lib.nameValuePair "local${toString i}" {path = f;})
|> lib.listToAttrs |> lib.listToAttrs
); );
"${service}_download_client_qbittorrent" = mkIf (lib.elem service ["radarr" "sonarr" "lidarr" "whisparr"]) {
"main" = {
name = "qBittorrent";
enable = true;
priority = 1;
host = "localhost";
username = "admin";
password = "poChieN5feeph0igeaCadeJ9Xux0ohmuy6ruH5ieThaPheib3iuzoo0ahw1aiceif1feegioh9Aimau0pai5thoh5ieH0aechohw";
url_base = "/";
port = 2008;
};
};
# "${service}_download_client_sabnzbd" = mkIf (lib.elem service ["radarr" "sonarr" "lidarr" "whisparr"]) {
# "main" = {
# name = "SABnzbd";
# enable = true;
# priority = 1;
# host = "localhost";
# url_base = "/";
# port = 8080;
# };
# };
}; };
}; };
}) })
@ -204,7 +231,7 @@ in {
cp -f ${terraformConfiguration} config.tf.json cp -f ${terraformConfiguration} config.tf.json
# Initialize OpenTofu # Initialize OpenTofu
${lib.getExe pkgs.opentofu} init -upgrade ${lib.getExe pkgs.opentofu} init
# Run the infrastructure code # Run the infrastructure code
${lib.getExe pkgs.opentofu} \ ${lib.getExe pkgs.opentofu} \
@ -272,6 +299,19 @@ in {
}; };
}; };
})) }))
|> lib.concat [
{
templates = {
"sabnzbd/config.ini" = {
owner = "sabnzbd";
group = "media";
content = ''
'';
};
};
}
]
|> lib.mkMerge; |> lib.mkMerge;
}; };
} }