diff --git a/flake.nix b/flake.nix index 90ef37e..fd1bac2 100644 --- a/flake.nix +++ b/flake.nix @@ -146,6 +146,7 @@ modules = [ ./hosts/monolith ./system/monolith-gitlab-runner.nix + ./system/monolith-bitbucket-runner.nix ./system/monolith-forgejo-runner.nix ./system/nix-serve.nix ] ++ common_modules; diff --git a/secrets/monolith/default.yaml b/secrets/monolith/default.yaml index 46cc388..3e1c99c 100644 --- a/secrets/monolith/default.yaml +++ b/secrets/monolith/default.yaml @@ -4,6 +4,11 @@ gitlab-runners: thoreb-telemetria-nix: ENC[AES256_GCM,data:zrZvG4be08ulpo7itbrprKK5csCMLvzZjrszfMw1XiJP0FyRTUd9nHgHpbAzbjj2KyT7kKngoZAyengvaTEhkT9sUi1pdGnvajAH8BDDOD0g4LJIHFl4,iv:3bSsTzU7gHx+MchuPg9kmb5xEDugmGPje8Jw74NpRJI=,tag:zffRr77lWbyLt7o/mywb5A==,type:str] thoreb-itinerario-nix: ENC[AES256_GCM,data:UdAAD0V895sFoEYR56sCG2LlpZugJ0K/nwkTygzWOnbTSmBRAcIQ8qVFPZGw+K+XMSLiCyio6Jp7k8AYP0K1VYm+6aEP3OkqR9FCLQTJgXo=,iv:UGUby50BYkn13OzItk6zZmxc5+SnbZZa4bebQHIow2A=,tag:LjDg3deWwdH2T71EtPo6jA==,type:str] docker-images-token: ENC[AES256_GCM,data:GGB/KSkjdAyhFKEspAh91ItbqEDf7K/LZSGSn+Jp7SxRfXpDzHIiMD8XJ9PTkGLeQGN4ug1i2nTYPS7d/P5OALWDU+1NPiV9nPdG0w7GERfu4g==,iv:6roabdOKX9xFMf0hWlECd73+943R+hFLos0e2dOpzns=,tag:LrASFc4DtN7aQ+3oOW/p/w==,type:str] +bitbucket-runners: + wopus-runner-1: ENC[AES256_GCM,data:gtH0T5n8qMYpvSv5ciN8+ScGlFDf9xE0FTxNP97vT/qsOCcaItTE+5P+DFcWw46onLED+1c+u0sArFbEsT3f8lyco9b+0l99uOQAxLZQzAXYH8zG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IhuMrsFdTz6TnPY0rdQnvHEu0P42yM=,tag:hrmwLX/CRhZfammJ2nfTPw==,type:str] sops: kms: [] gcp_kms: [] @@ -38,8 +43,8 @@ sops: TGNwNUQxN0VQMHErMGVZbG5CZW9kSGMK9TRcgSJQT73dYoQxrrqFW/FkKExLGT4T Xagi6Eq4rhT7pvaL4h3vglwbqkLPsHrWRSyhh0sAEIJ1WpvD+cFEMA== -----END AGE ENCRYPTED FILE----- - lastmodified: "2025-03-07T16:48:32Z" - mac: ENC[AES256_GCM,data:vyO1MMSRCoc8CK1wqXdgvvAiNP4NUXxpF1MPNsz2z9ioeu15ue2AYV+kWH3I94qUOZ93UM+Nbfx1sqN+JKpkbQ7iS8vY1NNwovEYtrp4FInr6esYOIJXSvvf/3wlWoquSaNACQnbjKJKgV05m24+hu/meIXMYs9sn2SxlnetTmg=,iv:W1jokO9Shhle0cWZpR5bonVdLPZAOo76h8sClMUYZbE=,tag:1Pg5f6q6TmBrAmYWuhKaKQ==,type:str] + lastmodified: "2025-03-07T21:28:04Z" + mac: ENC[AES256_GCM,data:4lOafZQ6PP38CByulzA/J86sw+TpQhj40s1lTRXqUtpt72yH8nQK8dXpw0dNYvDBtDpKRvNTHZubzalEua6n2lCQL7rsZ2+fo6FJ4ht2Kb70dddDcWEyrfyZQ2FaKC5L/QjqM0SbIfPszNvyQ8wIaOoMfNJBis5QOjRSGDAcJm8=,iv:LLT0oJW+3KNe1nKphCK0c5FPIuh8GfnDrvNDCFhP4NM=,tag:rPbVY7L1qxNc3aCfv77FAg==,type:str] pgp: - created_at: "2025-03-07T14:42:24Z" enc: |- diff --git a/system/monolith-bitbucket-runner.nix b/system/monolith-bitbucket-runner.nix new file mode 100644 index 0000000..17d462b --- /dev/null +++ b/system/monolith-bitbucket-runner.nix @@ -0,0 +1,50 @@ +{ + config, + pkgs, + ... +}: + +let + mkRunner = secret: { + image = "docker-public.packages.atlassian.com/sox/atlassian/bitbucket-pipelines-runner:latest"; + volumes = [ + "/tmp:/tmp" + "/var/run/docker.sock:/var/run/docker.sock" + "/var/lib/docker/containers:/var/lib/docker/containers:ro" + ]; + environmentFiles = [ secret ]; + }; + + secretConf = { + sopsFile = ../secrets/monolith/default.yaml; + }; +in +{ + virtualisation.docker = { + enable = true; + daemon.settings = { + # needed by bitbucket runner ??? + log-driver = "json-file"; + log-opts = { + max-size = "10m"; + max-file = "3"; + }; + }; + }; + + virtualisation.oci-containers.backend = "docker"; + + virtualisation.oci-containers.containers = { + bitbucket-runner-1 = mkRunner config.sops.secrets."bitbucket-runners/wopus-runner-1".path; + bitbucket-runner-2 = mkRunner config.sops.secrets."bitbucket-runners/wopus-runner-2".path; + bitbucket-runner-3 = mkRunner config.sops.secrets."bitbucket-runners/wopus-runner-3".path; + bitbucket-runner-4 = mkRunner config.sops.secrets."bitbucket-runners/wopus-runner-4".path; + }; + + sops.secrets = { + "bitbucket-runners/wopus-runner-1" = secretConf; + "bitbucket-runners/wopus-runner-2" = secretConf; + "bitbucket-runners/wopus-runner-3" = secretConf; + "bitbucket-runners/wopus-runner-4" = secretConf; + }; +}