feat: replace watchtower with podman auto-update
This commit is contained in:
parent
59d27f4367
commit
7beebf6a6a
|
@ -25,7 +25,6 @@ in with builtins; {
|
||||||
./services/wkd.nix
|
./services/wkd.nix
|
||||||
./services/home-assistant
|
./services/home-assistant
|
||||||
./services/matrix
|
./services/matrix
|
||||||
./services/watchtower.nix
|
|
||||||
./services/immich.nix
|
./services/immich.nix
|
||||||
./services/miniflux.nix
|
./services/miniflux.nix
|
||||||
./services/paperless.nix
|
./services/paperless.nix
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
{ 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 = {
|
|
||||||
# some containers take really long to shut down
|
|
||||||
WATCHTOWER_TIMEOUT = "120s";
|
|
||||||
WATCHTOWER_CLEANUP = "true";
|
|
||||||
WATCHTOWER_INCLUDE_STOPPED = "true";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,11 +1,31 @@
|
||||||
{ config, pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
environment.systemPackages = with pkgs; [ podman-compose ];
|
environment.systemPackages = with pkgs; [ podman-compose ];
|
||||||
|
|
||||||
virtualisation.podman.enable = true;
|
virtualisation.podman.enable = true;
|
||||||
virtualisation.podman.dockerCompat = true;
|
virtualisation.podman.dockerCompat = true;
|
||||||
virtualisation.podman.dockerSocket.enable = true;
|
|
||||||
virtualisation.podman.extraPackages = with pkgs; [ ];
|
|
||||||
virtualisation.podman.defaultNetwork.settings.dns_enabled = true;
|
virtualisation.podman.defaultNetwork.settings.dns_enabled = true;
|
||||||
|
|
||||||
|
virtualisation.podman.autoPrune.enable = true;
|
||||||
|
virtualisation.podman.autoPrune.dates = "weekly";
|
||||||
|
virtualisation.podman.autoPrune.flags = [ "--all" ];
|
||||||
|
|
||||||
|
systemd.services.podman-auto-update = {
|
||||||
|
wants = [ "network-online.target" ];
|
||||||
|
after = [ "network-online.target" ];
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
ExecStart = "${pkgs.podman}/bin/podman auto-update";
|
||||||
|
ExecStartPost = "${pkgs.podman}/bin/podman image prune -f";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.timers.podman-auto-update = {
|
||||||
|
wantedBy = [ "timers.target" ];
|
||||||
|
timerConfig = {
|
||||||
|
OnCalendar = "03:30";
|
||||||
|
Persistent = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue