From 9d20adc14572dab1eb38c2f669c20d8aa24f2aa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Schr=C3=B6ter?= Date: Fri, 16 Sep 2022 17:09:59 +0200 Subject: [PATCH] feat: add watchtower container To handle docker images & containers updates. --- home-server.nix | 1 + services/watchtower.nix | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 services/watchtower.nix diff --git a/home-server.nix b/home-server.nix index e1ac7b4..85a154d 100644 --- a/home-server.nix +++ b/home-server.nix @@ -24,6 +24,7 @@ in with builtins; { ./services/mosquitto.nix ./services/genie.nix ./services/home-assistant.nix + ./services/watchtower.nix ./services/owntracks.nix ./services/immich.nix ./services/miniflux.nix diff --git a/services/watchtower.nix b/services/watchtower.nix new file mode 100644 index 0000000..955ea85 --- /dev/null +++ b/services/watchtower.nix @@ -0,0 +1,18 @@ +{ config, lib, pkgs, ... }: + +# watchtower keeps images & containers up-to-date +{ + virtualisation.oci-containers.containers = { + watchtower = { + image = "containrrr/watchtower"; + volumes = [ + "/var/run/podman/podman.sock:/var/run/docker.sock" + "/etc/localtime:/etc/localtime:ro" + ]; + environment = { + WATCHTOWER_CLEANUP = "true"; + WATCHTOWER_INCLUDE_RESTARTING = "true"; + }; + }; + }; +}