add podman
This commit is contained in:
parent
2bfd892131
commit
d01553ebfe
3 changed files with 61 additions and 0 deletions
|
|
@ -5,6 +5,7 @@
|
|||
../common.nix
|
||||
../../services/openssh.nix
|
||||
../../services/prometheus-node.nix
|
||||
./podman.nix
|
||||
./forgejo-runner.nix
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
26
hosts/forgejo-runner/podman.nix
Normal file
26
hosts/forgejo-runner/podman.nix
Normal 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";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Reference in a new issue