add podman

This commit is contained in:
XenGi 2026-08-20 23:13:33 +02:00
commit d01553ebfe
Signed by: xengi
SSH key fingerprint: SHA256:dM+fLZGsDvyv6kunjE8bGduL24VsCFB4LEOSdmRHdG0
3 changed files with 61 additions and 0 deletions

View file

@ -5,6 +5,7 @@
../common.nix
../../services/openssh.nix
../../services/prometheus-node.nix
./podman.nix
./forgejo-runner.nix
];

View file

@ -49,4 +49,38 @@
};
};
};
systemd = {
services."forgejo-runner-container-updater" = {
description = "Update forgejo runner container images";
after = [ "network-online.target" ];
wants = [ "network-online.target" ];
serviceConfig.Type = "oneshot";
script = ''
set -uo pipefail
failed=0
images=(
docker.io/library/debian:stable-slim
docker.io/library/alpine:latest
docker.io/moby/buildkit:latest
)
for image in "''${images[@]}"; do
echo "Pulling $image..."
if ! ${pkgs.podman}/bin/podman pull "$image"; then
echo "Failed to pull $image"
failed=1
fi
done
exit $failed
'';
};
timers."forgejo-runner-container-updater" = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "daily";
RandomizedDelaySec = "30m";
Persistent = true;
};
};
};
}

View file

@ -0,0 +1,26 @@
{ ... }:
{
virtualisation.podman = {
enable = true;
dockerSocket.enable = true;
autoPrune = {
enable = true;
dates = "weekly";
};
defaultNetwork.settings = {
dns_enabled = true;
ipv6_enabled = true;
subnets = [
{
gateway = "10.88.0.1";
subnet = "10.88.0.0/16";
}
{
gateway = "fd10:88::1";
subnet = "fd10:88::/64";
}
];
};
};
}