feat(jellyfin): add automated docker image update service and timer
Some checks failed
Flake checker / Build Nix targets (push) Has been cancelled
Some checks failed
Flake checker / Build Nix targets (push) Has been cancelled
This commit is contained in:
@@ -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";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user