199 lines
5.5 KiB
Nix
199 lines
5.5 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
namespace,
|
|
...
|
|
}:
|
|
let
|
|
name = "arrs";
|
|
cfg = config.${namespace}.services.${name};
|
|
|
|
arrsConfig = lib.${namespace}.mkModule {
|
|
inherit config name;
|
|
serviceName = "sabnzbd";
|
|
description = "*arr Services";
|
|
options = { };
|
|
moduleConfig = {
|
|
sops = {
|
|
secrets = {
|
|
"jallen-nas/sabnzbd/password" = {
|
|
sopsFile = lib.snowfall.fs.get-file "secrets/nas-secrets.yaml";
|
|
};
|
|
"jallen-nas/sabnzbd/api-key" = {
|
|
sopsFile = lib.snowfall.fs.get-file "secrets/nas-secrets.yaml";
|
|
};
|
|
"jallen-nas/sabnzbd/nzb-key" = {
|
|
sopsFile = lib.snowfall.fs.get-file "secrets/nas-secrets.yaml";
|
|
};
|
|
"jallen-nas/sabnzbd/server/username" = {
|
|
sopsFile = lib.snowfall.fs.get-file "secrets/nas-secrets.yaml";
|
|
};
|
|
"jallen-nas/sabnzbd/server/password" = {
|
|
sopsFile = lib.snowfall.fs.get-file "secrets/nas-secrets.yaml";
|
|
};
|
|
};
|
|
templates = {
|
|
"sabnzbd.ini" = {
|
|
mode = "660";
|
|
owner = "nix-apps";
|
|
group = "jallen-nas";
|
|
restartUnits = [ "sabnzbd.service" ];
|
|
content = ''
|
|
[misc]
|
|
password = ${config.sops.placeholder."jallen-nas/sabnzbd/password"}
|
|
api_key = ${config.sops.placeholder."jallen-nas/sabnzbd/api-key"}
|
|
nzb_key = ${config.sops.placeholder."jallen-nas/sabnzbd/nzb-key"}
|
|
[servers]
|
|
[[news.newsgroupdirect.com]]
|
|
username = ${config.sops.placeholder."jallen-nas/sabnzbd/server/username"}
|
|
password = ${config.sops.placeholder."jallen-nas/sabnzbd/server/password"}
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
|
|
# Enable radarr service
|
|
services = {
|
|
radarr = {
|
|
inherit (cfg) openFirewall;
|
|
enable = true;
|
|
user = "nix-apps";
|
|
group = "jallen-nas";
|
|
dataDir = "${cfg.configDir}/radarr";
|
|
};
|
|
|
|
# Enable Sonarr service
|
|
sonarr = {
|
|
inherit (cfg) openFirewall;
|
|
enable = true;
|
|
user = "nix-apps";
|
|
group = "jallen-nas";
|
|
dataDir = "${cfg.configDir}/sonarr";
|
|
package = pkgs.sonarr;
|
|
};
|
|
|
|
lidarr = {
|
|
inherit (cfg) openFirewall;
|
|
enable = true;
|
|
user = "nix-apps";
|
|
group = "jallen-nas";
|
|
dataDir = "${cfg.configDir}/lidarr";
|
|
};
|
|
|
|
# Enable Sabnzbd service
|
|
sabnzbd = {
|
|
enable = true;
|
|
user = "nix-apps";
|
|
group = "jallen-nas";
|
|
secretFiles = [
|
|
config.sops.templates."sabnzbd.ini".path
|
|
];
|
|
configFile = null;
|
|
settings = lib.mkForce {
|
|
misc = {
|
|
host = "0.0.0.0";
|
|
port = 8280;
|
|
cache_limit = "10G";
|
|
download_dir = "${cfg.configDir}/downloads";
|
|
complete_dir = "${cfg.configDir}/incomplete";
|
|
username = "admin";
|
|
};
|
|
servers = {
|
|
"news.newsgroupdirect.com" = {
|
|
name = "news.newsgroupdirect.com";
|
|
displayname = "news.newsgroupdirect.com";
|
|
host = "news.newsgroupdirect.com";
|
|
port = 563;
|
|
timeout = 60;
|
|
connections = 8;
|
|
ssl = true;
|
|
ssl_verify = 2;
|
|
ssl_ciphers = "";
|
|
enable = true;
|
|
required = false;
|
|
optional = false;
|
|
retention = 0;
|
|
expire_date = "";
|
|
quota = "";
|
|
usage_at_start = 0;
|
|
priority = 0;
|
|
notes = "";
|
|
};
|
|
};
|
|
categories = {
|
|
"*" = {
|
|
name = "*";
|
|
order = 0;
|
|
pp = 3;
|
|
script = "None";
|
|
dir = "";
|
|
newzbin = "";
|
|
priority = 0;
|
|
};
|
|
audio = {
|
|
name = "audio";
|
|
order = 3;
|
|
pp = "";
|
|
script = "Default";
|
|
dir = "";
|
|
newzbin = "";
|
|
priority = -100;
|
|
};
|
|
software = {
|
|
name = "software";
|
|
order = 4;
|
|
pp = "";
|
|
script = "Default";
|
|
dir = "";
|
|
newzbin = "";
|
|
priority = -100;
|
|
};
|
|
"movies" = {
|
|
name = "movies";
|
|
order = 5;
|
|
pp = "";
|
|
script = "Default";
|
|
dir = "";
|
|
newzbin = "";
|
|
priority = -100;
|
|
};
|
|
"tv" = {
|
|
name = "tv";
|
|
order = 6;
|
|
pp = "";
|
|
script = "Default";
|
|
dir = "";
|
|
newzbin = "";
|
|
priority = -100;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
deluge = {
|
|
inherit (cfg) openFirewall dataDir;
|
|
enable = false;
|
|
user = "nix-apps";
|
|
group = "jallen-nas";
|
|
web = {
|
|
inherit (cfg) openFirewall;
|
|
enable = true;
|
|
port = 8112;
|
|
};
|
|
};
|
|
|
|
jackett = {
|
|
inherit (cfg) openFirewall;
|
|
enable = false;
|
|
user = "nix-apps";
|
|
group = "jallen-nas";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
in
|
|
{
|
|
imports = [ arrsConfig ];
|
|
}
|