2017-09-13 19:45:42 +00:00
|
|
|
{ config, pkgs, ... }:
|
2017-08-16 13:09:38 +00:00
|
|
|
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 {
|
2017-09-13 19:45:42 +00:00
|
|
|
systemd.services.gitlab-runner.path = [
|
2017-08-16 13:09:38 +00:00
|
|
|
"/run/wrappers" # /run/wrappers/bin/su
|
|
|
|
"/" # /bin/sh
|
|
|
|
];
|
2017-08-16 13:20:37 +00:00
|
|
|
systemd.services.gitlab-runner.serviceConfig.PrivateTmp = true;
|
2017-08-16 13:09:38 +00:00
|
|
|
virtualisation.docker.enable = true;
|
|
|
|
services.gitlab-runner = {
|
|
|
|
enable = true;
|
|
|
|
# configFile, configOptions and gracefulTimeout not yet in stable
|
|
|
|
# gracefulTimeout = "120min";
|
2017-09-13 19:45:42 +00:00
|
|
|
configFile = pkgs.writeText "gitlab-runner.cfg" ''
|
|
|
|
concurrent = 1
|
|
|
|
check_interval = 0
|
2017-08-16 13:09:38 +00:00
|
|
|
|
2017-09-13 19:45:42 +00:00
|
|
|
[[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]
|
2017-08-16 13:09:38 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|