From fb6a5444c994d295b9a8d061ceb62bd269dbe435 Mon Sep 17 00:00:00 2001 From: June Date: Sat, 22 Jun 2024 18:06:39 +0200 Subject: [PATCH] Last commit didn't do, switching to Docker instead of podman does --- config/hosts/woodpecker/secrets.yaml | 6 +++--- .../woodpecker/woodpecker-agent/default.nix | 2 +- .../woodpecker/woodpecker-agent/docker.nix | 12 +++++++++++ .../woodpecker/woodpecker-agent/podman.nix | 20 ------------------- .../woodpecker-agent/woodpecker-agent.nix | 7 +++---- 5 files changed, 19 insertions(+), 28 deletions(-) create mode 100644 config/hosts/woodpecker/woodpecker-agent/docker.nix delete mode 100644 config/hosts/woodpecker/woodpecker-agent/podman.nix diff --git a/config/hosts/woodpecker/secrets.yaml b/config/hosts/woodpecker/secrets.yaml index 6b960a7..091ca2e 100644 --- a/config/hosts/woodpecker/secrets.yaml +++ b/config/hosts/woodpecker/secrets.yaml @@ -1,5 +1,5 @@ woodpecker_server_environment_file: ENC[AES256_GCM,data:68Wu0UOHBAGZHSJ0x4wbeDLm626jpumv9w6A65FNKsmzYp6P4/c4g1MF1agQd7l9nKMTRrgyJyfoEZYFQRX6lYSmcsQLfn++uh1JpFoClT5p/5hBkiDq4owUFU+NGUiyl6yjYlEiaxLwC4ZdyISHeEYpbrvGyIXLsFgdrQ0rVX3cCRwIMxFcyCG6d3MZVoqAw1A=,iv:y/+X02aRPBOoR57P9s7y/SijvXVLuiBBfFYqeJLvQEU=,tag:DNwK+M6s3moglkMkrWccyA==,type:str] -woodpecker_agent_environment_file: ENC[AES256_GCM,data:7K+Q59QM9ZIr/SE8VQ9jmshjVSeXGzk+h2T9oIDJASZrYppTFx2N68wsKyFm/Y1GDLY3QEELGXOCa7nSZcdMJTOJ9jj5u7HMw3e0CQGxMUGP,iv:vyDQO7uMxyHpK/cb739sktuAq3zv2MZ9xexAZHD0Of4=,tag:WzNn4iWGlO63aLeStsCdRA==,type:str] +woodpecker_agent_environment_file: ENC[AES256_GCM,data:rwp6TYYFJ/IZH+3pGhPxjdZMLoyPMr/W1RXm4IkUGn+SmIjHZcdFZ8nEhvOfnkfrXNPc2MR+X6NXUmVOcBjSCbcBjh9sC653UpKimt9I3/Ec,iv:X9JH7dmTayw8BaEsXYil3PrykCdd+/ANGHVfEyRvc7A=,tag:/ErkX1WnruanNgTTBUT6LA==,type:str] sops: kms: [] gcp_kms: [] @@ -15,8 +15,8 @@ sops: UExiNFNCdkQ4YTNMdEdoWTdxOFZOZVEKZZbNpbyH31z5tyXeINqoNyqy8zvS3mp0 YFq6P8kO8CaqUG7KH6yWV0Vq4DryQ9vMcQBnboZOfPf9pZUvhacE/Q== -----END AGE ENCRYPTED FILE----- - lastmodified: "2024-06-22T14:24:28Z" - mac: ENC[AES256_GCM,data:1MCBR0fU1wMwmTqLKi6ybFD5YX/yYFMO1JLUpB+ZB+PYH+lvYUwo7x52BNxDDETq+VtU13CJLIM0LleOWl0h0xP9vbMC/YMn+ffeWVBYC8mjqaKXYVyAW8ksXn+vDQ+ZP/RWGOJdaKIPLgIJiVF5hfkSo6smfH378cH72f5cmU4=,iv:BgKHSsElxULJ2EA+8/5w4J/hNLH2S+jNNRTXAl/96V4=,tag:z1HeWXA6Ryo0SacG9HARhw==,type:str] + lastmodified: "2024-06-22T15:55:25Z" + mac: ENC[AES256_GCM,data:UmDbmxSRj8YfCkKEelQNMJ8mzbu5aQdB9yOr9JfUh5TB9r5Z5ttZ1wgJDJqHNtsII3JGXUvbgHbsmbPikkrj4Ege1rrgr4UttN1rtgeaAKlZIlqb9pOnV4//GJL8jbxCgFp2h2O80G05nAXG54DaY//4Y5hfTyPzgyDlGQ6jlhg=,iv:5e8lpFfGAJh8lTFcY4MlZG7PgnzM0UycsU0tB2KN+zQ=,tag:4xUEHg04wjDbhc9MOItzuQ==,type:str] pgp: - created_at: "2024-06-21T22:42:59Z" enc: |- diff --git a/config/hosts/woodpecker/woodpecker-agent/default.nix b/config/hosts/woodpecker/woodpecker-agent/default.nix index 1b51267..279d2bb 100644 --- a/config/hosts/woodpecker/woodpecker-agent/default.nix +++ b/config/hosts/woodpecker/woodpecker-agent/default.nix @@ -2,7 +2,7 @@ { imports = [ - ./podman.nix + ./docker.nix ./woodpecker-agent.nix ]; } diff --git a/config/hosts/woodpecker/woodpecker-agent/docker.nix b/config/hosts/woodpecker/woodpecker-agent/docker.nix new file mode 100644 index 0000000..af13f4c --- /dev/null +++ b/config/hosts/woodpecker/woodpecker-agent/docker.nix @@ -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; + }; +} diff --git a/config/hosts/woodpecker/woodpecker-agent/podman.nix b/config/hosts/woodpecker/woodpecker-agent/podman.nix deleted file mode 100644 index c76740b..0000000 --- a/config/hosts/woodpecker/woodpecker-agent/podman.nix +++ /dev/null @@ -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 ]; - }; -} diff --git a/config/hosts/woodpecker/woodpecker-agent/woodpecker-agent.nix b/config/hosts/woodpecker/woodpecker-agent/woodpecker-agent.nix index 7eac510..dc89021 100644 --- a/config/hosts/woodpecker/woodpecker-agent/woodpecker-agent.nix +++ b/config/hosts/woodpecker/woodpecker-agent/woodpecker-agent.nix @@ -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" ]; }; }