depot/ops/nixos/lib/deluge.nix

46 lines
1.1 KiB
Nix
Raw Normal View History

# 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;
web.enable = true;
package = depot.pkgs.deluge;
};
2022-04-09 19:59:11 +00:00
my.vault.secrets.deluge-auth-file = {
reloadOrRestartUnits = ["deluge.service"];
group = "deluge";
template = ''
{{ with secret "kv/apps/pomerium" }}
{{ .Data.data.authfile }}
{{ end }}
'';
};
}