2023-03-31 18:27:25 +02:00
|
|
|
{ pkgs, lib, config, ... }:
|
|
|
|
|
|
|
|
{
|
2023-09-04 21:36:31 +02:00
|
|
|
age.secrets.ovniToken.file = ../../secrets/ovni-token.age;
|
|
|
|
age.secrets.nosvToken.file = ../../secrets/nosv-token.age;
|
2023-04-11 12:47:52 +02:00
|
|
|
|
2023-03-31 18:27:25 +02:00
|
|
|
services.gitlab-runner = {
|
|
|
|
enable = true;
|
2023-05-02 17:38:10 +02:00
|
|
|
settings.concurrent = 5;
|
2023-03-31 18:27:25 +02:00
|
|
|
services = {
|
2023-04-11 12:47:52 +02:00
|
|
|
ovni-shell = {
|
2023-09-04 21:36:31 +02:00
|
|
|
registrationConfigFile = config.age.secrets.ovniToken.path;
|
2023-03-31 18:27:25 +02:00
|
|
|
executor = "shell";
|
|
|
|
tagList = [ "nix" "xeon" ];
|
|
|
|
environmentVariables = {
|
|
|
|
SHELL = "${pkgs.bash}/bin/bash";
|
|
|
|
};
|
|
|
|
};
|
2023-04-11 12:47:52 +02:00
|
|
|
ovni-docker = {
|
2023-09-04 21:36:31 +02:00
|
|
|
registrationConfigFile = config.age.secrets.ovniToken.path;
|
2023-04-03 12:51:44 +02:00
|
|
|
dockerImage = "debian:stable";
|
|
|
|
tagList = [ "docker" "xeon" ];
|
|
|
|
registrationFlags = [ "--docker-network-mode host" ];
|
|
|
|
environmentVariables = {
|
2023-04-11 12:59:21 +02:00
|
|
|
https_proxy = "http://localhost:23080";
|
|
|
|
http_proxy = "http://localhost:23080";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
nosv-docker = {
|
2023-09-04 21:36:31 +02:00
|
|
|
registrationConfigFile = config.age.secrets.nosvToken.path;
|
2023-04-11 12:59:21 +02:00
|
|
|
dockerImage = "debian:stable";
|
|
|
|
tagList = [ "docker" "xeon" ];
|
2023-05-02 17:47:57 +02:00
|
|
|
registrationFlags = [
|
|
|
|
"--docker-network-mode host"
|
|
|
|
"--docker-cpus 56"
|
|
|
|
];
|
2023-04-11 12:59:21 +02:00
|
|
|
environmentVariables = {
|
2023-04-03 12:51:44 +02:00
|
|
|
https_proxy = "http://localhost:23080";
|
|
|
|
http_proxy = "http://localhost:23080";
|
|
|
|
};
|
|
|
|
};
|
2023-03-31 18:27:25 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
#systemd.services.gitlab-runner.serviceConfig.Shell = "${pkgs.bash}/bin/bash";
|
|
|
|
systemd.services.gitlab-runner.serviceConfig.DynamicUser = lib.mkForce false;
|
|
|
|
systemd.services.gitlab-runner.serviceConfig.User = "gitlab-runner";
|
|
|
|
systemd.services.gitlab-runner.serviceConfig.Group = "gitlab-runner";
|
2023-04-06 13:56:52 +02:00
|
|
|
systemd.services.gitlab-runner.serviceConfig.ExecStart = lib.mkForce
|
2023-04-11 12:58:24 +02:00
|
|
|
''${pkgs.gitlab-runner}/bin/gitlab-runner run --config ''${HOME}/.gitlab-runner/config.toml --listen-address "127.0.0.1:9252" --working-directory ''${HOME}'';
|
2023-04-03 12:51:44 +02:00
|
|
|
|
2023-03-31 18:27:25 +02:00
|
|
|
users.users.gitlab-runner = {
|
|
|
|
uid = config.ids.uids.gitlab-runner;
|
|
|
|
#isNormalUser = true;
|
|
|
|
home = "/var/lib/gitlab-runner";
|
|
|
|
description = "Gitlab Runner";
|
|
|
|
group = "gitlab-runner";
|
2023-04-03 12:51:44 +02:00
|
|
|
extraGroups = [ "docker" ];
|
2023-03-31 18:27:25 +02:00
|
|
|
createHome = true;
|
|
|
|
};
|
|
|
|
users.groups.gitlab-runner.gid = config.ids.gids.gitlab-runner;
|
|
|
|
}
|