Skip to content

Commit 736c6be

Browse files
committed
remove unecessary bits, add user & group options to sabnzbd
1 parent 5566de0 commit 736c6be

2 files changed

Lines changed: 16 additions & 11 deletions

File tree

flake.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/sabnzbd/default.nix

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@ in {
2929
description = "Whether to enable SABnzbd usenet downloader";
3030
};
3131

32+
group = mkOption {
33+
type = types.str;
34+
default = "sabnzbd";
35+
description = "Group under which the service runs";
36+
};
37+
38+
user = mkOption {
39+
type = types.str;
40+
default = "media";
41+
description = "User under which the service runs";
42+
};
43+
3244
downloadsDir = mkOption {
3345
type = types.str;
3446
default = "${nixflix.downloadsDir}/usenet";
@@ -136,9 +148,8 @@ in {
136148

137149
# Enable sabnzbd service
138150
services.sabnzbd = {
151+
inherit (cfg) user group;
139152
enable = true;
140-
user = "sabnzbd";
141-
group = "media";
142153
configFile = "/var/lib/sabnzbd/sabnzbd.ini";
143154
};
144155

@@ -158,12 +169,6 @@ in {
158169
export SABNZBD_API_KEY=$(${pkgs.coreutils}/bin/cat ${cfg.apiKeyPath})
159170
''}
160171
161-
# Export environment secrets
162-
${concatMapStringsSep "\n" (secret: ''
163-
export ${secret.env}=$(${pkgs.coreutils}/bin/cat ${secret.path})
164-
'')
165-
cfg.environmentSecrets}
166-
167172
# Substitute environment variables in template
168173
${pkgs.envsubst}/bin/envsubst < /etc/sabnzbd/sabnzbd.ini.template > /var/lib/sabnzbd/sabnzbd.ini
169174

0 commit comments

Comments
 (0)