From 01e03496102875f404e6b271a01d3979e8d31a11 Mon Sep 17 00:00:00 2001 From: servius Date: Tue, 13 Jan 2026 00:28:12 +0530 Subject: [PATCH] feat(jellyfin): add automated docker image update service and timer --- nixos/tsuba/services/jellyfin.nix | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/nixos/tsuba/services/jellyfin.nix b/nixos/tsuba/services/jellyfin.nix index b0e8c65b..384ec7f4 100644 --- a/nixos/tsuba/services/jellyfin.nix +++ b/nixos/tsuba/services/jellyfin.nix @@ -1,5 +1,5 @@ { - unstablePkgs, + pkgs, config, ... }: { @@ -46,4 +46,24 @@ ''; }; }; + systemd.services.jellyfin-image-update = { + description = "Pull latest Jellyfin Docker image"; + serviceConfig = { + Type = "oneshot"; + ExecStart = "${pkgs.docker}/bin/docker pull ghcr.io/jellyfin/jellyfin:latest"; + ExecStartPost = "${pkgs.systemd}/bin/systemctl restart docker-jellyfin.service"; + }; + }; + + # Systemd timer to run the update service every 5 days + systemd.timers.jellyfin-image-update = { + description = "Timer for Jellyfin image updates"; + wantedBy = ["timers.target"]; + timerConfig = { + OnCalendar = "Mon *-*-* 02:00:00"; + OnUnitInactiveSec = "5d"; + Persistent = true; + RandomizedDelaySec = "1h"; + }; + }; }