Last commit didn't do, switching to Docker instead of podman does

This commit is contained in:
June 2024-06-22 18:06:39 +02:00
commit 026e47d055
Signed by: june
SSH key fingerprint: SHA256:o9EAq4Y9N9K0pBQeBTqhSDrND5E7oB+60ZNx0U1yPe0
5 changed files with 19 additions and 28 deletions

View file

@ -2,7 +2,7 @@
{
imports = [
./podman.nix
./docker.nix
./woodpecker-agent.nix
];
}

View file

@ -0,0 +1,12 @@
# Sources for this configuration:
# - https://woodpecker-ci.org/docs/administration/deployment/nixos
# - https://woodpecker-ci.org/docs/administration/backends/docker
# - https://nixos.wiki/wiki/Docker
{ config, pkgs, ... }:
{
virtualisation.docker = {
enable = true;
};
}

View file

@ -1,20 +0,0 @@
# Sources for this configuration:
# - https://woodpecker-ci.org/docs/administration/deployment/nixos
# - https://woodpecker-ci.org/docs/administration/backends/docker
# - https://nixos.wiki/wiki/Podman
{ config, pkgs, ... }:
{
virtualisation.podman = {
enable = true;
defaultNetwork.settings.dns_enabled = true;
};
networking.firewall.interfaces."podman0" = {
# allowedUDPPorts = [ 53 ] gets already set by virtualisation.podman.defaultNetwork.settings.dns_enabled, but set it here explicitly anyway.
allowedUDPPorts = [ 53 ];
# For git.hamburg.ccc.de to resolve in the clone step for example, allowedTCPPorts also needs to be set to allow DNS.
allowedTCPPorts = [ 53 ];
};
}

View file

@ -6,16 +6,15 @@
{ config, pkgs, pkgs-unstable, ... }:
{
services.woodpecker-agents.agents."podman" = {
services.woodpecker-agents.agents."docker" = {
enable = true;
# Since we use woodpecker-server from unstable, use the agent from unstable as well.
package = pkgs-unstable.woodpecker-agent;
extraGroups = [ "podman" ];
extraGroups = [ "docker" ];
environment = {
WOODPECKER_SERVER = "localhost${config.services.woodpecker-server.environment.WOODPECKER_GRPC_ADDR}";
WOODPECKER_MAX_WORKFLOWS = "4";
WOODPECKER_BACKEND = "docker";
DOCKER_HOST = "unix:///run/podman/podman.sock";
# Set via enviornmentFile:
# WOODPECKER_AGENT_SECRET
};
@ -26,6 +25,6 @@
mode = "0440";
owner = "root";
group = "root";
restartUnits = [ "woodpecker-agent-podman.service" ];
restartUnits = [ "woodpecker-agent-docker.service" ];
};
}