From b4ded5b2ced767dae9caf8892f58fc76643f435b Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Tue, 12 Dec 2023 18:39:09 +0100 Subject: [PATCH] feat(containers): Move image storage and factorize some code --- machines/storage01/gitea-actions-runner.nix | 33 +++++++++++++-------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/machines/storage01/gitea-actions-runner.nix b/machines/storage01/gitea-actions-runner.nix index 499834f..d128f35 100644 --- a/machines/storage01/gitea-actions-runner.nix +++ b/machines/storage01/gitea-actions-runner.nix @@ -1,34 +1,35 @@ { pkgs, ... }: -let url = "https://git.dgnum.eu"; +let + url = "https://git.dgnum.eu"; + mkRunner = { labels, name, token }: { + enable = true; + + inherit name labels token url; + + settings.container = { + network = "host"; + options = [ "--cpus=4" ]; + }; + }; in { services.gitea-actions-runner = { package = pkgs.forgejo-actions-runner; - instances = { + instances = builtins.mapAttrs (_: mkRunner) { runner01 = { - enable = true; - - inherit url; token = "qT9nZXKgLcb3fWOj7VTj3S58raiCWwF0weuIIKlY"; name = "storage01 [debian]"; labels = [ "debian-latest:docker://node:20-bookworm" ]; - - settings = { container.network = "host"; }; }; runner02 = { - enable = true; - - inherit url; token = "m0rUDBxxkMb6xLTmPFwIieHswJFROqPFByPlT3V9"; name = "storage01 [debian]"; labels = [ "debian-latest:docker://node:20-bookworm" ]; - - settings = { container.network = "host"; }; }; }; }; @@ -41,4 +42,12 @@ in { ipv6_enabled = true; }; }; + + virtualisation.containers.storage.settings = { + storage = { + driver = "overlay"; + graphroot = "/data/slow/containers/storage"; + runroot = "/run/containers/storage"; + }; + }; }