Add gitlab-runner to Linode

This commit is contained in:
Greg Hellings
2024-05-01 19:46:34 +00:00
parent e5400a3edf
commit 4cd66ec1b5
4 changed files with 67 additions and 2 deletions
+37 -1
View File
@@ -1,4 +1,4 @@
{ pkgs, lib, ... }:
{ pkgs, lib, config, ... }:
{
imports = [
@@ -26,6 +26,7 @@
];
networking = {
networkmanager.enable = lib.mkForce false;
hostName = "linode";
domain = "thehellings.com";
nameservers = [
@@ -33,6 +34,41 @@
];
};
age.secrets.runner-deployer = {
file = ../../secrets/gitlab/linode-deployer-runner-reg.age;
owner = "gitlab-runner";
};
services.gitlab-runner = {
enable = true;
services.deployer = {
executor = "shell";
registrationConfigFile = config.age.secrets.runner-deployer.path;
};
};
users.users.gitlab-runner = {
isSystemUser = true;
group = "gitlab-runner";
};
users.groups.gitlab-runner = {};
systemd.services."gitlab-runner".serviceConfig = {
DynamicUser = lib.mkForce false;
User = "gitlab-runner";
};
security.sudo.extraRules = [{
users = [ "gitlab-runner" ];
commands = [{
command = "/run/current-system/sw/bin/systemctl";
options = [ "NOPASSWD" ];
} {
command = "/run/current-system/sw/bin/podman";
options = [ "NOPASSWD" ];
}];
}];
environment.systemPackages = with pkgs; [
bind
graphviz