From b949f5e9c75004d647643e821ac76c251e87b28d Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Fri, 17 Mar 2023 00:08:43 +0100 Subject: [PATCH] arion: Improvements to podman setup --- system/nixos/arion.nix | 46 +++++++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/system/nixos/arion.nix b/system/nixos/arion.nix index 337e09d..5eb4936 100644 --- a/system/nixos/arion.nix +++ b/system/nixos/arion.nix @@ -10,23 +10,51 @@ podman = { enable = true; - dockerSocket.enable = true; + defaultNetwork.settings.dns_enabled = true; + + dockerSocket.enable = true; + dockerCompat = true; + + autoPrune = { + enable = true; + dates = "weekly"; + }; }; - containers.containersConf.cniPlugins = with pkgs; [ - cni-plugins - dnsname-cni - ]; + # containers.containersConf.cniPlugins = with pkgs; [ + # cni-plugins + # dnsname-cni + # ]; - oci-containers.backend = "podman"; + oci-containers = { + backend = "podman"; + + containers.watchtower = { + image = "ghcr.io/containrrr/watchtower:latest"; + environment = { + WATCHTOWER_POLL_INTERVAL = "21600"; + WATCHTOWER_LABEL_ENABLE = "true"; + WATCHTOWER_NOTIFICATIONS = "shoutrrr"; + WATCHTOWER_NOTIFICATIONS_HOSTNAME = config.networking.hostName; + WATCHTOWER_NOTIFICATION_URL = secret.watchtower.ntfyUrl; + }; + volumes = [ + "/var/run/docker.sock:/var/run/docker.sock" + ]; + extraOptions = [ + "--label=com.centurylinklabs.watchtower.enable=true" + ]; + }; + }; arion = { backend = "podman-socket"; }; }; - networking.firewall.interfaces."podman1".allowedUDPPorts = [ 53 ]; - networking.firewall.interfaces."podman2".allowedUDPPorts = [ 53 ]; - networking.firewall.interfaces."podman3".allowedUDPPorts = [ 53 ]; + networking.firewall.interfaces."podman+" = { + allowedUDPPorts = [ 53 ]; + allowedTCPPorts = [ 53 ]; + }; }