From c96960786f020b67e9d20d312c4802cf818fd608 Mon Sep 17 00:00:00 2001 From: winston Date: Mon, 3 Jul 2023 03:43:57 +0200 Subject: [PATCH] feat(oci): add auto prune --- config/services/containers.nix | 54 +++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 23 deletions(-) diff --git a/config/services/containers.nix b/config/services/containers.nix index 116f261..0cdbecf 100644 --- a/config/services/containers.nix +++ b/config/services/containers.nix @@ -6,32 +6,40 @@ }; websitePort = "14139"; in { - virtualisation.oci-containers.containers = { - faerber-bot = { - image = "ghcr.io/nekowinston/faerber/faerber-discord-bot:latest"; - environmentFiles = [ - config.age.secrets."containers/faerber.env".path - ]; - }; - - pepperjack = { - image = "docker.io/phasecorex/red-discordbot:latest"; - environment = { - TOKEN = "~"; - OWNER = "505490445468696576"; + virtualisation = { + podman = { + enable = true; + autoPrune = { + enable = true; + dates = "03:30"; }; - environmentFiles = [ - config.age.secrets."containers/pepperjack.env".path - ]; - volumes = [ - "/srv/data-pepperjack:/data" - ]; }; - website = { - image = "ghcr.io/nekowinston/winston.sh/winston-sh:latest"; - login = ghcrLogin; - ports = ["127.0.0.1:${websitePort}:3000"]; + oci-containers = { + backend = "podman"; + + containers = { + faerber-bot = { + image = "ghcr.io/nekowinston/faerber/faerber-discord-bot:latest"; + environmentFiles = [config.age.secrets."containers/faerber.env".path]; + }; + + pepperjack = { + image = "docker.io/phasecorex/red-discordbot:latest"; + environment = { + TOKEN = "~"; + OWNER = "505490445468696576"; + }; + environmentFiles = [config.age.secrets."containers/pepperjack.env".path]; + volumes = ["/srv/data-pepperjack:/data"]; + }; + + website = { + image = "ghcr.io/nekowinston/winston.sh/winston-sh:latest"; + login = ghcrLogin; + ports = ["127.0.0.1:${websitePort}:3000"]; + }; + }; }; };