Refactor sabnzbd config to use settings and secretFiles

Switch sabnzbd configuration to use the settings and secretFiles options
instead of a static config file. Add support for nzbkey secret. Update
sops template to include nzb_key and remove duplicated server and misc
settings.
This commit is contained in:
Chris Kruining 2026-03-04 10:44:11 +01:00
parent a97c244c4f
commit 95ae5b8b83
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2

View file

@ -98,8 +98,28 @@ in {
sabnzbd = { sabnzbd = {
enable = true; enable = true;
openFirewall = true; openFirewall = true;
configFile = "/var/media/sabnzbd/config.ini";
# configFile = config.sops.templates."sabnzbd/config.ini".path; secretFiles = [
config.sops.templates."sabnzbd/config.ini".path
];
settings = {
misc = {
port = 2009;
download_dir = "/var/media/downloads/incomplete";
complete_dir = "/var/media/downloads/done";
};
servers = {
"news.sunnyusenet.com" = {
displayname = "news.sunnyusenet.com";
host = "news.sunnyusenet.com";
port = 563;
timeout = 60;
};
};
};
user = "sabnzbd"; user = "sabnzbd";
group = "media"; group = "media";
@ -402,6 +422,7 @@ in {
secrets = { secrets = {
"qbittorrent/password" = {}; "qbittorrent/password" = {};
"sabnzbd/apikey" = {}; "sabnzbd/apikey" = {};
"sabnzbd/nzbkey" = {};
"sabnzbd/sunnyweb/username" = {}; "sabnzbd/sunnyweb/username" = {};
"sabnzbd/sunnyweb/password" = {}; "sabnzbd/sunnyweb/password" = {};
}; };
@ -428,36 +449,14 @@ in {
group = "media"; group = "media";
mode = "0660"; mode = "0660";
content = '' content = ''
__version__ = 19
__encoding__ = utf-8
[misc] [misc]
download_dir = /var/media/downloads/incomplete
complete_dir = /var/media/downloads/done
api_key = ${config.sops.placeholder."sabnzbd/apikey"} api_key = ${config.sops.placeholder."sabnzbd/apikey"}
log_dir = logs nzb_key = ${config.sops.placeholder."sabnzbd/nzbkey"}
[servers] [servers]
[[news.sunnyusenet.com]] [[news.sunnyusenet.com]]
name = news.sunnyusenet.com
displayname = news.sunnyusenet.com
host = news.sunnyusenet.com
port = 563
timeout = 60
username = ${config.sops.placeholder."sabnzbd/sunnyweb/username"} username = ${config.sops.placeholder."sabnzbd/sunnyweb/username"}
password = ${config.sops.placeholder."sabnzbd/sunnyweb/password"} password = ${config.sops.placeholder."sabnzbd/sunnyweb/password"}
connections = 8
ssl = 1
ssl_verify = 3
ssl_ciphers = ""
enable = 1
required = 0
optional = 0
retention = 0
expire_date = ""
quota = ""
usage_at_start = 0
priority = 1
notes = ""
''; '';
}; };
}; };