From 8bc99186542a913ae28adef5848452270d23b683 Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Mon, 11 Dec 2023 10:29:38 +0100 Subject: [PATCH] podman: keep certain images --- system/nixos/container.nix | 4 ++-- system/nixos/forgejo-runner.nix | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/system/nixos/container.nix b/system/nixos/container.nix index fa907d4..b23c205 100644 --- a/system/nixos/container.nix +++ b/system/nixos/container.nix @@ -15,7 +15,7 @@ autoPrune = { enable = true; dates = "weekly"; - flags = [ "--all" ]; + flags = [ "--all" "--filter=label!=io.kempkens.keepImage" ]; }; }; @@ -55,7 +55,7 @@ { Type = "oneshot"; ExecStart = "${podman}/bin/podman auto-update"; - ExecStartPost = "${podman}/bin/podman image prune -f"; + ExecStartPost = "${podman}/bin/podman image prune -f --filter=label!=io.kempkens.keepImage"; }; }; } diff --git a/system/nixos/forgejo-runner.nix b/system/nixos/forgejo-runner.nix index f067b7b..bc27c8f 100644 --- a/system/nixos/forgejo-runner.nix +++ b/system/nixos/forgejo-runner.nix @@ -56,7 +56,7 @@ in NSSWITCH tar -cv . | tar -tvf - - tar -cv . | podman import - forgejo-runner-nix + tar -cv . | podman import --change "LABEL io.kempkens.keepImage=true" - forgejo-runner-nix ''; serviceConfig = { RuntimeDirectory = "forgejo-runner-nix-image";