mirror of
https://github.com/kittywitch/nixfiles.git
synced 2026-02-09 12:29:19 -08:00
complete dir
This commit is contained in:
parent
7b56d66e48
commit
1685fe55ac
1 changed files with 22 additions and 12 deletions
|
|
@ -1,19 +1,28 @@
|
|||
{ config, lib, ... }: let
|
||||
{ config, lib, ... }: with lib; let
|
||||
cfg = config.services.mediatomb;
|
||||
shadowDir = "/mnt/shadow";
|
||||
inherit (config.services) deluge;
|
||||
delugeDir = "${shadowDir}/deluge";
|
||||
in {
|
||||
services.mediatomb = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
serverName = config.networking.hostName;
|
||||
uuid = "082fd344-bf69-5b72-a68f-a5a4d88e76b2";
|
||||
mediaDirectories = lib.singleton {
|
||||
path = "${shadowDir}/media";
|
||||
recursive = true;
|
||||
hidden-files = false;
|
||||
};
|
||||
mediaDirectories = [
|
||||
{
|
||||
path = "${shadowDir}/media";
|
||||
recursive = true;
|
||||
hidden-files = false;
|
||||
}
|
||||
(mkIf deluge.enable {
|
||||
path = delugeDir;
|
||||
recursive = true;
|
||||
hidden-files = false;
|
||||
})
|
||||
];
|
||||
};
|
||||
systemd.services.mediatomb = rec {
|
||||
systemd.services.mediatomb = {
|
||||
confinement.enable = true;
|
||||
unitConfig = {
|
||||
RequiresMountsFor = [
|
||||
|
|
@ -22,11 +31,12 @@ in {
|
|||
};
|
||||
serviceConfig = {
|
||||
StateDirectory = cfg.package.pname;
|
||||
BindReadOnlyPaths = map (path: "${shadowDir}/media/${path}") [
|
||||
"anime" "movies" "tv" "unsorted"
|
||||
"music" "music-to-import" "music-raw"
|
||||
] ++ [
|
||||
"${shadowDir}/deluge/complete"
|
||||
BindReadOnlyPaths = mkMerge [
|
||||
(map (path: "${shadowDir}/media/${path}") [
|
||||
"anime" "movies" "tv" "unsorted"
|
||||
"music" "music-to-import" "music-raw"
|
||||
])
|
||||
(mkIf deluge.enable [ "${delugeDir}/complete" ])
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue