From 9d6aa88d2d47d5d5283db23442923544b35679c7 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sat, 11 Mar 2023 18:15:45 +0000 Subject: [PATCH] ops/nixos: add gitlab-runner-cacher, unassign clouvider-lon01, assign cofractal-ams01 --- ops/nixos/clouvider-lon01/default.nix | 32 ---------------------- ops/nixos/cofractal-ams01/default.nix | 1 + ops/nixos/lib/gitlab-runner-cacher.nix | 38 ++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 32 deletions(-) create mode 100644 ops/nixos/lib/gitlab-runner-cacher.nix diff --git a/ops/nixos/clouvider-lon01/default.nix b/ops/nixos/clouvider-lon01/default.nix index dc5b58a3ce..60a3552fd1 100644 --- a/ops/nixos/clouvider-lon01/default.nix +++ b/ops/nixos/clouvider-lon01/default.nix @@ -256,38 +256,6 @@ (bindMountSvcDynamic "factorio" "factorio.service") ]; - my.vault.secrets.gitlab-runner-environment = { - restartUnits = ["gitlab-runner.service"]; - group = "root"; - template = '' - {{ with secret "kv/apps/gitlab-runner" }} - {{ .Data.data.environment }} - {{ end }} - ''; - }; - services.gitlab-runner = { - enable = true; - settings.concurrent = 1; - services = { - deployer = { - registrationConfigFile = config.my.vault.secrets.gitlab-runner-environment.path; - executor = "shell"; - tagList = [ "cacher" ]; - }; - }; - gracefulTermination = true; - gracefulTimeout = "4min"; - package = depot.nix.pkgs.heptapod-runner; - }; - users.users.gitlab-runner = { - isNormalUser = true; - group = "nogroup"; - createHome = true; - home = "/srv/gitlab-runner"; - }; - - nix.gc.automatic = false; - services.factorio = { inherit (depot.ops.secrets.factorio) username token; enable = true; diff --git a/ops/nixos/cofractal-ams01/default.nix b/ops/nixos/cofractal-ams01/default.nix index 1f19df7ae9..11d4822664 100644 --- a/ops/nixos/cofractal-ams01/default.nix +++ b/ops/nixos/cofractal-ams01/default.nix @@ -8,6 +8,7 @@ ../lib/zfs.nix ../lib/bgp.nix ../lib/nixbuild-distributed.nix + ../lib/gitlab-runner-cacher.nix ]; # Otherwise _this_ machine won't enumerate things properly. diff --git a/ops/nixos/lib/gitlab-runner-cacher.nix b/ops/nixos/lib/gitlab-runner-cacher.nix new file mode 100644 index 0000000000..b96f20070c --- /dev/null +++ b/ops/nixos/lib/gitlab-runner-cacher.nix @@ -0,0 +1,38 @@ +# SPDX-FileCopyrightText: 2020 Luke Granger-Brown +# +# SPDX-License-Identifier: Apache-2.0 + +{ depot, lib, pkgs, config, ... }: +{ + my.vault.secrets.gitlab-runner-environment = { + restartUnits = ["gitlab-runner.service"]; + group = "root"; + template = '' + {{ with secret "kv/apps/gitlab-runner" }} + {{ .Data.data.environment }} + {{ end }} + ''; + }; + services.gitlab-runner = { + enable = true; + settings.concurrent = 1; + services = { + deployer = { + registrationConfigFile = config.my.vault.secrets.gitlab-runner-environment.path; + executor = "shell"; + tagList = [ "cacher" ]; + }; + }; + gracefulTermination = true; + gracefulTimeout = "4min"; + package = depot.nix.pkgs.heptapod-runner; + }; + users.users.gitlab-runner = { + isNormalUser = true; + group = "nogroup"; + createHome = true; + home = "/srv/gitlab-runner"; + }; + + nix.gc.automatic = false; +}