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:
@@ -74,6 +74,40 @@ in {
|
||||
|
||||
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 = {
|
||||
backend = "podman";
|
||||
containers.homeassistant = {
|
||||
|
||||
Reference in New Issue
Block a user