1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00

home-assistant: auto-update container

This commit is contained in:
2025-12-19 11:56:02 +01:00
parent af1e852228
commit 1060339a93

View File

@@ -74,6 +74,40 @@ in {
hardware.bluetooth.enable = true; hardware.bluetooth.enable = true;
systemd.services.update-containers = {
startAt = "Mon 02:00";
script = ''
images=$(${pkgs.podman}/bin/podman ps -a --format="{{.Image}}" | sort -u)
for image in $images; do
${pkgs.podman}/bin/podman pull "$image"
done
'';
serviceConfig = {
Type = "oneshot";
Restart = "on-failure";
RestartSec = "1h";
};
};
systemd.services.restart-homeassistant = {
startAt = "Tue 02:00";
script = ''
${pkgs.systemd}/bin/systemctl try-restart podman-homeassistant.service
'';
serviceConfig = {
Type = "oneshot";
};
};
virtualisation.podman = {
enable = true;
autoPrune = {
enable = true;
flags = ["--all"];
};
};
virtualisation.oci-containers = { virtualisation.oci-containers = {
backend = "podman"; backend = "podman";
containers.homeassistant = { containers.homeassistant = {