aboutsummaryrefslogtreecommitdiff
path: root/nixos
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2022-11-03 12:21:46 +0100
committerKarel Kočí <cynerd@email.cz>2022-11-03 12:21:46 +0100
commita01159cb22acfb754037047e5c060df2b5b2caeb (patch)
tree6f46c7fdbecf536f87a18eedccde8de0578b1ebe /nixos
parent8be16711771879a1b57a673edbadb98776e022cf (diff)
downloadnixos-personal-a01159cb22acfb754037047e5c060df2b5b2caeb.tar.gz
nixos-personal-a01159cb22acfb754037047e5c060df2b5b2caeb.tar.bz2
nixos-personal-a01159cb22acfb754037047e5c060df2b5b2caeb.zip
nixos/mrpump: add runners for NixTurris
Diffstat (limited to 'nixos')
-rw-r--r--nixos/machine/mrpump.nix79
1 files changed, 40 insertions, 39 deletions
diff --git a/nixos/machine/mrpump.nix b/nixos/machine/mrpump.nix
index d00e249..0740085 100644
--- a/nixos/machine/mrpump.nix
+++ b/nixos/machine/mrpump.nix
@@ -56,47 +56,48 @@ with lib;
# Gitlab runner
systemd.services.gitlab-runner.serviceConfig = let
+ runners = project: [
+ {
+ name = "MrPump Docker (${project})";
+ url = "https://gitlab.com";
+ id = 18138767;
+ token = "@TOKEN_${toUpper project}_DOCKER@";
+ executor = "docker";
+ docker = {
+ image = "alpine";
+ };
+ }
+ {
+ name = "MrPump Nix (${project})";
+ url = "https://gitlab.com";
+ id = 18139391;
+ token = "@TOKEN_${toUpper project}_NIX@";
+ executor = "docker";
+ docker = {
+ image = "local/nix:latest";
+ allowed_images = ["local/nix:latest"];
+ pull_policy = "if-not-present";
+ allowed_pull_policies = ["if-not-present"];
+ volumes_from = ["gitlabnix:ro"];
+ };
+ environment = [
+ "NIX_REMOTE=daemon"
+ "ENV=/etc/profile.d/nix-daemon.sh"
+ "BASH_ENV=/etc/profile.d/nix-daemon.sh"
+ ];
+ # TODO for some reason the /tmp seems to be missing
+ # The cp is required to allow modification of nix config for cachix as
+ # otherwise it is link to the read only file in the store.
+ pre_build_script = ''
+ mkdir -p /tmp
+ cp --remove-destination \
+ $(readlink -f /etc/nix/nix.conf) /etc/nix/nix.conf
+ '';
+ }
+ ];
config = (pkgs.formats.toml{}).generate "gitlab-runner.toml" {
concurrent = 1;
- runners = [
- {
- name = "MrPump Docker (LogC)";
- url = "https://gitlab.com";
- id = 18138767;
- token = "@TOKEN_LOGC_DOCKER@";
- executor = "docker";
- docker = {
- image = "alpine";
- };
- }
- {
- name = "MrPump Nix (LogC)";
- url = "https://gitlab.com";
- id = 18139391;
- token = "@TOKEN_LOGC_NIX@";
- executor = "docker";
- docker = {
- image = "local/nix:latest";
- allowed_images = ["local/nix:latest"];
- pull_policy = "if-not-present";
- allowed_pull_policies = ["if-not-present"];
- volumes_from = ["gitlabnix:ro"];
- };
- environment = [
- "NIX_REMOTE=daemon"
- "ENV=/etc/profile.d/nix-daemon.sh"
- "BASH_ENV=/etc/profile.d/nix-daemon.sh"
- ];
- pre_build_script = ''
- # TODO for some reason the /tmp seems to be missing
- mkdir -p /tmp
- # We need to allow modification of nix config for cachix as
- # otherwise it is link to the read only file in the store.
- cp --remove-destination \
- $(readlink -f /etc/nix/nix.conf) /etc/nix/nix.conf
- '';
- }
- ];
+ runners = (runners "LogC") ++ (runners "NixTurris");
};
configPath = "$HOME/.gitlab-runner/config.toml";
configureScript = pkgs.writeShellScript "gitlab-runner-configure" ''