Added jellyfin to dingserver

This commit is contained in:
2022-06-30 14:07:23 +01:00
parent 7736586670
commit 97f205789b
3 changed files with 48 additions and 1 deletions

View File

@@ -0,0 +1,38 @@
{
pkgs,
config,
...
}: let
mountdir = "/var/media/dungflix";
file = ''
[dungflix]
type = b2
'';
in {
age.secrets = {
dungflix_bucket_account_id.file = ../../secrets/dungflix_bucket_account_id.age;
dungflix_bucket_account_key.file = ../../secrets/dungflix_bucket_account_key.age;
};
systemd.services.dungflix-mount = {
description = "Mount the Backblaze B2 media store";
wantedBy = ["multi-user.target"];
path = [pkgs.fuse];
preStart = ''
mkdir -p -m 777 ${mountdir}
'';
script = ''
export RCLONE_B2_ACCOUNT=''$(cat ${config.age.secrets.dungflix_bucket_account_id.path})
export RCLONE_B2_KEY=''$(cat ${config.age.secrets.dungflix_bucket_account_key.path})
${pkgs.rclone}/bin/rclone --config="${pkgs.writeText "" file}" mount dungflix:dungflix-bucket ${mountdir} \
--vfs-cache-mode full \
--vfs-cache-max-age 48h \
--vfs-cache-max-size 100G \
--allow-other \
--no-modtime \
--buffer-size 2G \
-vvv
'';
postStop = "fusermount -u ${mountdir}";
};
}