nix: use upstream gitlab-runner module

This migrates to the upstream gitlab-runner module and allows removing
the custom one \o/
This commit is contained in:
steveej 2020-10-17 16:17:09 +02:00
parent 405ca2ade4
commit 4ca173efd4
3 changed files with 21 additions and 174 deletions

View file

@ -2,12 +2,10 @@
{
disabledModules = [
"services/continuous-integration/gitlab-runner.nix"
];
imports = [
../../profiles/common/configuration.nix
../../modules/encryptedDisk.nix
../../modules/gitlab-runner.nix
./system.nix
./hw.nix

View file

@ -10,7 +10,15 @@
};
home-manager.users.steveej = import ../../../home-manager/configuration/text-minimal.nix { inherit pkgs; };
services.hydra = {
nix.buildMachines = [
{ hostName = "localhost";
system = "x86_64-linux";
supportedFeatures = ["kvm" "nixos-test" "big-parallel" "benchmark"];
maxJobs = 4;
}
];
services.hydra = {
enable = false;
hydraURL = "http://localhost:3000"; # externally visible URL
notificationSender = "hydra@${config.networking.hostName}.stefanjunker.de"; # e-mail of hydra service
@ -20,18 +28,10 @@
useSubstitutes = true;
};
nix.buildMachines = [
{ hostName = "localhost";
system = "x86_64-linux";
supportedFeatures = ["kvm" "nixos-test" "big-parallel" "benchmark"];
maxJobs = 4;
}
];
services.gitlab-runner = {
enable = true;
packages = with pkgs; [
extraPackages = with pkgs; [
bash
gitlab-runner
nix
@ -39,18 +39,16 @@
git-crypt
];
configFile = let
nixRunnerToken = "/etc/secrets/gitlab-runner/nix-runner.token";
in pkgs.writeText "config.toml" ''
concurrent = 2
check_interval = 0
[[runners]]
name = "nix-runner"
url = "https://gitlab.com"
token = "<% sed -z 's/[\n\s]//g' ${nixRunnerToken} %>"
executor = "shell"
shell = "bash"
[runners.cache]
'';
concurrent = 2;
checkInterval = 0;
services = {
nixRunner = {
executor = "shell";
runUntagged = true;
registrationConfigFile = "/etc/secrets/gitlab-runner/nix-runner.registration";
tagList = [ "nix" ];
};
};
};
}