From bd6a84c0d6637375a56c9d215db60b898ccb4099 Mon Sep 17 00:00:00 2001 From: cy Date: Tue, 17 Dec 2024 16:41:58 -0500 Subject: [PATCH] add jellyfin and deluge and some rclone config improvements --- hosts/chunk/Caddyfile | 10 ++++++++++ hosts/chunk/default.nix | 2 ++ hosts/chunk/deluge.nix | 9 +++++++++ hosts/chunk/jellyfin.nix | 7 +++++++ hosts/chunk/rclone.nix | 32 ++++++++++++++++++++++++-------- 5 files changed, 52 insertions(+), 8 deletions(-) create mode 100644 hosts/chunk/deluge.nix create mode 100644 hosts/chunk/jellyfin.nix diff --git a/hosts/chunk/Caddyfile b/hosts/chunk/Caddyfile index 679aae2..d7d412b 100644 --- a/hosts/chunk/Caddyfile +++ b/hosts/chunk/Caddyfile @@ -73,3 +73,13 @@ grafana.cything.io { import common reverse_proxy localhost:8088 } + +warez.cything.io { + import common + reverse_proxy localhost:8096 +} + +t.cything.io { + import common + reverse_proxy localhost:8112 +} diff --git a/hosts/chunk/default.nix b/hosts/chunk/default.nix index f7d7482..5cbde9e 100644 --- a/hosts/chunk/default.nix +++ b/hosts/chunk/default.nix @@ -24,6 +24,8 @@ ./ghost.nix ./conduit.nix ./immich.nix + ./jellyfin.nix + ./deluge.nix ]; sops.age.keyFile = "/root/.config/sops/age/keys.txt"; diff --git a/hosts/chunk/deluge.nix b/hosts/chunk/deluge.nix new file mode 100644 index 0000000..ba5a275 --- /dev/null +++ b/hosts/chunk/deluge.nix @@ -0,0 +1,9 @@ +{...}: { + services.deluge = { + enable = true; + web = { + enable = true; + port = 8112; + }; + }; +} diff --git a/hosts/chunk/jellyfin.nix b/hosts/chunk/jellyfin.nix new file mode 100644 index 0000000..cb55204 --- /dev/null +++ b/hosts/chunk/jellyfin.nix @@ -0,0 +1,7 @@ +{...}: { + services.jellyfin = { + enable = true; + dataDir = "/mnt/jellyfin"; + configDir = "/var/lib/jellyfin/config"; + }; +} diff --git a/hosts/chunk/rclone.nix b/hosts/chunk/rclone.nix index f70bc83..8f12b8f 100644 --- a/hosts/chunk/rclone.nix +++ b/hosts/chunk/rclone.nix @@ -6,28 +6,44 @@ systemd.services.immich-mount = { enable = true; description = "Mount the immich data remote"; - after = ["network-online.target"]; + after = ["network-online.target" "podman-immich-server.service"]; requires = ["network-online.target"]; - wantedBy = ["default.target"]; + requiredBy = ["podman-immich-server.service"]; serviceConfig = { Type = "notify"; ExecStartPre = "/usr/bin/env mkdir -p /mnt/photos"; - ExecStart = "${pkgs.rclone}/bin/rclone mount --config /home/yt/.config/rclone/rclone.conf --transfers=32 --dir-cache-time 720h --poll-interval 0 --vfs-cache-mode writes photos: /mnt/photos "; + ExecStart = "${pkgs.rclone}/bin/rclone mount --config /home/yt/.config/rclone/rclone.conf --transfers=32 --dir-cache-time 72h --poll-interval 0 --vfs-cache-mode writes photos: /mnt/photos "; ExecStop = "/bin/fusermount -u /mnt/photos"; EnvironmentFile = config.sops.secrets."rclone/env".path; }; }; - systemd.services.nextcloud-mount = { + # systemd.services.nextcloud-mount = { + # enable = true; + # description = "Mount the nextcloud data remote"; + # after = ["network-online.target"]; + # requires = ["network-online.target"]; + # wantedBy = ["default.target"]; + # serviceConfig = { + # Type = "notify"; + # ExecStartPre = "/usr/bin/env mkdir -p /mnt/nextcloud"; + # ExecStart = "${pkgs.rclone}/bin/rclone mount --config /home/yt/.config/rclone/rclone.conf --uid 33 --gid 0 --allow-other --file-perms 0770 --dir-perms 0770 --transfers=32 rsyncnet:nextcloud /mnt/nextcloud"; + # ExecStop = "/bin/fusermount -u /mnt/nextcloud"; + # EnvironmentFile = config.sops.secrets."rclone/env".path; + # }; + # }; + + systemd.services.jellyfin-mount = { enable = true; description = "Mount the nextcloud data remote"; - after = ["network-online.target"]; + after = ["network-online.target" "jellyfin.service"]; requires = ["network-online.target"]; - wantedBy = ["default.target"]; + requiredBy = ["jellyfin.service"]; serviceConfig = { Type = "notify"; - ExecStart = "${pkgs.rclone}/bin/rclone mount --config /home/yt/.config/rclone/rclone.conf --uid 33 --gid 0 --allow-other --file-perms 0770 --dir-perms 0770 --transfers=32 rsyncnet:nextcloud /mnt/nextcloud"; - ExecStop = "/bin/fusermount -u /mnt/nextcloud"; + ExecStartPre = "/usr/bin/env mkdir -p /mnt/jellyfin"; + ExecStart = "${pkgs.rclone}/bin/rclone mount --config /home/yt/.config/rclone/rclone.conf --allow-other --transfers=32 --vfs-cache-mode writes jellyfin: /mnt/jellyfin"; + ExecStop = "/bin/fusermount -u /mnt/jellyfin"; EnvironmentFile = config.sops.secrets."rclone/env".path; }; };