mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
chore(tewi): remove /mnt/shadow
This commit is contained in:
parent
a191777943
commit
166b68492b
6 changed files with 103 additions and 207 deletions
|
|
@ -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)
|
||||
]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue