2022-01-23 16:58:29 +00:00
|
|
|
# SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
{ depot, lib, pkgs, rebuilder, config, ... }:
|
|
|
|
let
|
|
|
|
inherit (depot.ops) secrets;
|
|
|
|
in {
|
|
|
|
imports = [
|
|
|
|
./content.nix
|
|
|
|
];
|
|
|
|
|
|
|
|
users.users.deluge.extraGroups = [ "content" ];
|
|
|
|
users.users.lukegb.extraGroups = [ "deluge" ];
|
|
|
|
|
|
|
|
services.deluge = {
|
|
|
|
enable = true;
|
|
|
|
declarative = true;
|
|
|
|
openFirewall = true;
|
|
|
|
dataDir = "/store/deluge";
|
|
|
|
config = {
|
|
|
|
upnp = false;
|
|
|
|
natpmp = false;
|
|
|
|
max_active_seeding = 900;
|
|
|
|
max_active_downloading = 100;
|
|
|
|
max_active_limit = 1000;
|
|
|
|
move_completed_paths_list = [ "/store/content/Anime" "/store/content/Films" "/store/content/TV" ];
|
|
|
|
enabled_plugins = [ "Label" ];
|
|
|
|
};
|
2022-04-09 19:59:11 +00:00
|
|
|
authFile = config.my.vault.secrets.deluge-auth-file.path;
|
2022-01-23 16:58:29 +00:00
|
|
|
|
|
|
|
web.enable = true;
|
|
|
|
package = depot.pkgs.deluge;
|
|
|
|
};
|
2022-04-09 19:59:11 +00:00
|
|
|
|
|
|
|
my.vault.secrets.deluge-auth-file = {
|
2022-04-09 20:51:24 +00:00
|
|
|
reloadOrRestartUnits = ["deluged.service"];
|
2022-04-09 19:59:11 +00:00
|
|
|
group = "deluge";
|
|
|
|
template = ''
|
2022-04-09 20:51:24 +00:00
|
|
|
{{ with secret "kv/apps/deluge" }}
|
2022-04-09 19:59:11 +00:00
|
|
|
{{ .Data.data.authfile }}
|
|
|
|
{{ end }}
|
|
|
|
'';
|
|
|
|
};
|
2022-01-23 16:58:29 +00:00
|
|
|
}
|