mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
33 lines
685 B
Nix
33 lines
685 B
Nix
{
|
|
config,
|
|
lib,
|
|
...
|
|
}: let
|
|
inherit (lib.options) mkOption;
|
|
inherit (lib.modules) mkIf mkMerge;
|
|
cfg = config.services.deluge;
|
|
in {
|
|
options.services.deluge = with lib.types; {
|
|
downloadDir = mkOption {
|
|
type = path;
|
|
default = cfg.dataDir + "/Downloads";
|
|
};
|
|
completedDir = mkOption {
|
|
type = nullOr path;
|
|
default = null;
|
|
};
|
|
};
|
|
config = {
|
|
services.deluge = {
|
|
config = mkMerge [
|
|
{
|
|
download_location = cfg.downloadDir;
|
|
move_completed = cfg.completedDir != null;
|
|
}
|
|
(mkIf (cfg.completedDir != null) {
|
|
move_completed_path = cfg.completedDir;
|
|
})
|
|
];
|
|
};
|
|
};
|
|
}
|