fix: podman auto prune images and delete old update script
This commit is contained in:
parent
f3ef4ff11c
commit
507779e306
2 changed files with 2 additions and 39 deletions
|
|
@ -15,6 +15,8 @@ let
|
||||||
do
|
do
|
||||||
$SUDO ${pkgs.podman}/bin/podman pull $image
|
$SUDO ${pkgs.podman}/bin/podman pull $image
|
||||||
done
|
done
|
||||||
|
|
||||||
|
$SUDO ${pkgs.podman}/bin/podman image prune -af
|
||||||
'';
|
'';
|
||||||
in {
|
in {
|
||||||
users.groups.podman.gid = cids.gids.podman;
|
users.groups.podman.gid = cids.gids.podman;
|
||||||
|
|
|
||||||
|
|
@ -1,39 +0,0 @@
|
||||||
{ config, pkgs, ... }:
|
|
||||||
let
|
|
||||||
update-containers = pkgs.writeShellScriptBin "update-containers" ''
|
|
||||||
SUDO=""
|
|
||||||
if [[ $(id -u) -ne 0 ]]; then
|
|
||||||
SUDO="sudo"
|
|
||||||
fi
|
|
||||||
|
|
||||||
images=$($SUDO ${pkgs.podman}/bin/podman ps -a --format="{{.Image}}" | sort -u)
|
|
||||||
|
|
||||||
for image in $images
|
|
||||||
do
|
|
||||||
$SUDO ${pkgs.podman}/bin/podman pull $image
|
|
||||||
done
|
|
||||||
'';
|
|
||||||
in {
|
|
||||||
systemd.timers = {
|
|
||||||
# ...
|
|
||||||
updatecontainers = {
|
|
||||||
timerConfig = {
|
|
||||||
Unit = "updatecontainers.service";
|
|
||||||
OnCalendar = "02:00";
|
|
||||||
};
|
|
||||||
wantedBy = [ "timers.target" ];
|
|
||||||
};
|
|
||||||
# ...
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services = {
|
|
||||||
# ...
|
|
||||||
updatecontainers = {
|
|
||||||
serviceConfig = {
|
|
||||||
Type = "oneshot";
|
|
||||||
ExecStart = "update-containers";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
# ...
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue