chore(tewi): remove /mnt/shadow

This commit is contained in:
arcnmx 2024-01-16 10:02:37 -08:00
parent a191777943
commit 166b68492b
6 changed files with 103 additions and 207 deletions

View file

@ -3,7 +3,8 @@
lib,
...
}: let
inherit (lib) mkDefault;
inherit (lib.modules) mkIf mkAfter mkDefault;
inherit (lib.strings) hasPrefix removePrefix;
cfg = config.services.deluge;
in {
sops.secrets.deluge-auth = {
@ -33,4 +34,25 @@ in {
};
authFile = config.sops.secrets.deluge-auth.path;
};
services.mediatomb.mediaDirectories = let
parent = builtins.dirOf cfg.config.download_location;
hasCompletedSubdir = cfg.config.move_completed && hasPrefix parent cfg.config.move_completed_path;
completedSubdir = removePrefix parent cfg.config.move_completed_path;
downloadDir = if hasCompletedSubdir then {
path = parent;
subdirectories = [
(builtins.baseNameOf cfg.config.download_location)
completedSubdir
];
} else {
path = cfg.config.download_location;
};
completedDir = {
path = cfg.config.move_completed_path;
};
in mkIf cfg.enable (mkAfter [
downloadDir
(mkIf (cfg.config.move_completed && !hasCompletedSubdir) completedDir)
]);
}