summaryrefslogtreecommitdiffstats
path: root/krebs/2configs/gitlab-runner-shackspace.nix
blob: 7794f1dd23a6c5c9f5c11edc4ae0f313b8fde257 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{ config, ... }:
let
  url = "https://git.shackspace.de/";
  # generate token from CI-token via:
  ## gitlab-runner register
  ## cat /etc/gitlab-runner/config.toml
  token = import <secrets/shackspace-gitlab-ci-token.nix> ;
in {
  systemd.services.gitlab-runner.path = [ 
    "/run/wrappers" # /run/wrappers/bin/su
    "/" # /bin/sh
  ];
  virtualisation.docker.enable = true;
  services.gitlab-runner = {
    enable = true;
    # configFile, configOptions and gracefulTimeout not yet in stable
    # gracefulTimeout = "120min";
    configText = ''
    concurrent = 1
    check_interval = 0

    [[runners]]
      name = "krebs-shell"
      url = "${url}"
      token = "${token}"
      executor = "shell"
      shell = "sh"
      environment = ["PATH=/bin:/run/wrappers/bin:/etc/per-user/gitlab-runner/bin:/etc/per-user-pkgs/gitlab-runner/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin"]
      [runners.cache]

    '';
  };
}