add gitea jobs and runner configuration
All checks were successful
/ perform flake analysis (push) Successful in 32s
/ build hive configuration (push) Successful in 8m44s

build and deploy colmena hive using gitea actions
This commit is contained in:
shobu
2025-11-12 00:10:13 +01:00
committed by Awen Lelu
parent 733a125f77
commit 65a47967da
13 changed files with 194 additions and 253 deletions

View File

@@ -1,10 +1,56 @@
{nodes, ...}:{
{
nodes,
inputs,
pkgs,
...
}:
let
sin-address = "192.168.1.14";
unstable = import inputs.unstable { system = pkgs.system; };
in
{
imports = [
./virtualisation.nix
];
networking.nat.forwardPorts = [{
sourcePort = nodes.sin.config.services.gitea.settings.server.SSH_PORT;
proto = "tcp";
destination = "10.0.0.4:22";
}];
networking.nat.forwardPorts = [
{
sourcePort = nodes.sin.config.services.gitea.settings.server.SSH_PORT;
proto = "tcp";
destination = "${sin-address}:22";
}
];
services.gitea-actions-runner.package = unstable.gitea-actions-runner;
# services.gitea-actions-runner.instances = {
# "gitea.shobu.fr-runner" = {
# enable = true;
# name = "gitea.shobu.fr-runner";
# url = nodes.sin.config.services.gitea.settings.server.ROOT_URL;
# token = "uEDPBW6Z9oItAKRtloVwis0LkPbD4OmV2w5esOhW";
# labels = [
# "ubuntu-22.04:docker://docker.gitea.com/runner-images:ubuntu-22.04"
# ];
# settings = {
# cache = {
# # Enable cache server to use actions/cache.
# enabled = true;
# # The directory to store the cache data.
# # If it's empty, the cache data will be stored in $HOME/.cache/actcache.
# dir = "";
# # The host of the cache server.
# # It's not for the address to listen, but the address to connect from job containers.
# # So 0.0.0.0 is a bad choice, leave it empty to detect automatically.
# host = "";
# # The port of the cache server.
# # 0 means to use a random available port.
# port = 0;
# # The external cache server URL. Valid only when enable is true.
# # If it's specified, act_runner will use this URL as the ACTIONS_CACHE_URL rather than start a server by itself.
# # The URL should generally end with "/".
# external_server = "";
# };
# };
# };
# };
}

View File

@@ -1,4 +1,5 @@
{nodes, pkgs, ...}: {
{ nodes, pkgs, ... }:
{
systemd.sockets.podman.socketConfig.Symlinks = [
"/run/docker.sock"
];
@@ -15,32 +16,34 @@
};
};
virtualisation.oci-containers.containers = let
runner_config = pkgs.writeTextFile {
name = "config.yml";
text = ''
virtualisation.oci-containers.containers =
let
runner_config = pkgs.writeTextFile {
name = "config.yml";
text = ''
container:
network: "bridge"
network: "host"
'';
};
in {
gitea-runner = {
image = "gitea/act_runner@sha256:8477d5b61b655caad4449888bae39f1f34bebd27db56cb15a62dccb3dcf3a944";
autoStart = true;
# capabilities = {
# NET_RAW = true;
# };
environment = {
GITEA_INSTANCE_URL = nodes.sin.config.services.gitea.settings.server.ROOT_URL;
GITEA_RUNNER_REGISTRATION_TOKEN = "uEDPBW6Z9oItAKRtloVwis0LkPbD4OmV2w5esOhW";
CONFIG_FILE = "/config.yml";
};
volumes = [
"/var/run/docker.sock:/var/run/docker.sock"
"${runner_config}:/config.yml:ro"
];
in
{
gitea-runner = {
image = "gitea/act_runner@sha256:8477d5b61b655caad4449888bae39f1f34bebd27db56cb15a62dccb3dcf3a944";
autoStart = true;
# capabilities = {
# NET_RAW = true;
# };
environment = {
GITEA_INSTANCE_URL = nodes.sin.config.services.gitea.settings.server.ROOT_URL;
GITEA_RUNNER_REGISTRATION_TOKEN = "uEDPBW6Z9oItAKRtloVwis0LkPbD4OmV2w5esOhW";
CONFIG_FILE = "/config.yml";
};
volumes = [
"/var/run/docker.sock:/var/run/docker.sock"
"${runner_config}:/config.yml:ro"
];
};
};
};
}