Consolidate Gitea runners on NixOS
Deploy cloud-pc / deploy (push) Failing after 1s
Deploy mini-pc / deploy (push) Failing after 0s
NixOS switch mini-pc / switch (push) Has been cancelled
NixOS switch cloud-pc / switch (push) Has been cancelled

Add the docker group to the runner services and allow passwordless
nixos-rebuild for the gitea-runner user.
This commit is contained in:
Dmitry
2026-05-30 12:35:48 +03:00
parent 27bdb48466
commit 9148838e12
6 changed files with 36 additions and 42 deletions
-4
View File
@@ -1,4 +0,0 @@
FROM gitea/act_runner:latest
USER root
RUN apk add --no-cache docker-cli docker-cli-compose
-13
View File
@@ -1,13 +0,0 @@
services:
gitea-runner:
build: .
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /opt/services:/opt/services
- /opt/data/gitea-runner:/data
environment:
GITEA_INSTANCE_URL: https://git.ada-dev.ru
GITEA_RUNNER_REGISTRATION_TOKEN: ${TOKEN}
GITEA_RUNNER_NAME: cloud-pc-runner
GITEA_RUNNER_LABELS: cloud-pc
-4
View File
@@ -1,4 +0,0 @@
FROM gitea/act_runner:latest
USER root
RUN apk add --no-cache docker-cli docker-cli-compose
-13
View File
@@ -1,13 +0,0 @@
services:
gitea-runner:
build: .
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /opt/services:/opt/services
- /opt/data/gitea-runner:/data
environment:
GITEA_INSTANCE_URL: https://git.ada-dev.ru
GITEA_RUNNER_REGISTRATION_TOKEN: ${TOKEN}
GITEA_RUNNER_NAME: mini-pc-runner
GITEA_RUNNER_LABELS: mini-pc
+18 -4
View File
@@ -80,13 +80,27 @@
"d /mnt/yandex 0755 ada users - -"
];
services.gitea-actions-runner.instances."cloud-pc-nixos" = {
services.gitea-actions-runner.instances."cloud-pc" = {
enable = true;
name = "cloud-pc-nixos";
name = "cloud-pc";
url = "https://git.ada-dev.ru";
tokenFile = "/etc/gitea-runner/cloud-pc-nixos.token";
labels = [ "cloud-pc-nixos" ];
tokenFile = "/etc/gitea-runner/cloud-pc.token";
labels = [ "cloud-pc" "cloud-pc-nixos" ];
};
systemd.services."gitea-runner-cloud-pc".serviceConfig.SupplementaryGroups = [ "docker" ];
security.sudo.extraRules = [
{
users = [ "gitea-runner" ];
commands = [
{
command = "/run/current-system/sw/bin/nixos-rebuild";
options = [ "NOPASSWD" ];
}
];
}
];
system.stateVersion = "25.11";
}
+18 -4
View File
@@ -75,13 +75,27 @@
}
'';
services.gitea-actions-runner.instances."mini-pc-nixos" = {
services.gitea-actions-runner.instances."mini-pc" = {
enable = true;
name = "mini-pc-nixos";
name = "mini-pc";
url = "https://git.ada-dev.ru";
tokenFile = "/etc/gitea-runner/mini-pc-nixos.token";
labels = [ "mini-pc-nixos" ];
tokenFile = "/etc/gitea-runner/mini-pc.token";
labels = [ "mini-pc" "mini-pc-nixos" ];
};
systemd.services."gitea-runner-mini-pc".serviceConfig.SupplementaryGroups = [ "docker" ];
security.sudo.extraRules = [
{
users = [ "gitea-runner" ];
commands = [
{
command = "/run/current-system/sw/bin/nixos-rebuild";
options = [ "NOPASSWD" ];
}
];
}
];
system.stateVersion = "25.11";
}