Loadsamoney
This commit is contained in:
@@ -4,26 +4,15 @@
|
||||
...
|
||||
}: let
|
||||
mountdir = "/var/media/danflix";
|
||||
|
||||
rclone_config = pkgs.writeText "" ''
|
||||
[danflix-storage-box]
|
||||
type = sftp
|
||||
sftp_md5sum_command = md5sum
|
||||
sftp_sha1sum_command = sha1sum
|
||||
|
||||
[danflix-crypto]
|
||||
type = crypt
|
||||
remote = danflix-storage-box:danflix
|
||||
'';
|
||||
in {
|
||||
age.secrets = {
|
||||
danflix_storage_box_crypt_obscured_pw.file = ../../secrets/danflix_storage_box_crypt_obscured_pw.age;
|
||||
danflix_hetzner_storage_box_pub_key.file = ../../secrets/danflix_hetzner_storage_box_pub_key.age;
|
||||
danflix_env_file.file = ../../secrets/danflix_env_file.age;
|
||||
danflix_rclone_config.file = ../../secrets/danflix_rclone_config.age;
|
||||
};
|
||||
|
||||
services = {
|
||||
jellyfin.enable = true;
|
||||
jellyfin.group = "media";
|
||||
|
||||
transmission = {
|
||||
enable = true;
|
||||
@@ -55,7 +44,7 @@ in {
|
||||
"RCLONE_SFTP_KEY_FILE" = config.age.secrets.danflix_hetzner_storage_box_pub_key.path;
|
||||
};
|
||||
script = ''
|
||||
${pkgs.rclone}/bin/rclone --config="${rclone_config}" mount danflix-crypto: ${mountdir} \
|
||||
${pkgs.rclone}/bin/rclone --config="${config.age.secrets.danflix_rclone_config.path}" mount danflix-union: ${mountdir} \
|
||||
--vfs-cache-mode full \
|
||||
--vfs-cache-max-age 336h \
|
||||
--vfs-cache-max-size 60G \
|
||||
@@ -70,14 +59,13 @@ in {
|
||||
'';
|
||||
postStart = ''
|
||||
sleep 5
|
||||
${pkgs.rclone}/bin/rclone --config="${rclone_config}" rc vfs/refresh recursive=true _async=true
|
||||
${pkgs.rclone}/bin/rclone --config="${config.age.secrets.danflix_rclone_config.path}" rc vfs/refresh recursive=true _async=true
|
||||
'';
|
||||
postStop = ''
|
||||
sleep 3
|
||||
${pkgs.fuse3}/bin/fusermount -u ${mountdir}
|
||||
'';
|
||||
serviceConfig = {
|
||||
EnvironmentFile = config.age.secrets.danflix_env_file.path;
|
||||
Restart = "on-failure";
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user