fix: streamline Gitea runners
This commit is contained in:
@@ -9,14 +9,6 @@
|
|||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
age.secrets = {
|
|
||||||
gitea-runner-isaiah-podman.file = ../../../secrets/gitea/runner-isaiah-podman.age;
|
|
||||||
gitea-workerPassword.file = ../../../secrets/gitea/workerPassword.age;
|
|
||||||
runner-reg.file = ../../../secrets/gitlab/kubernetes-k3s-local.age;
|
|
||||||
# TODO: Greg add agenix secret at secrets/gitea-runner-isaiah.age
|
|
||||||
# gitea-runner-isaiah.file = ../../../secrets/gitea-runner-isaiah.age;
|
|
||||||
};
|
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
binfmt.emulatedSystems = [ "aarch64-linux" ];
|
binfmt.emulatedSystems = [ "aarch64-linux" ];
|
||||||
extraModprobeConfig = "options kvm_amd nested=1";
|
extraModprobeConfig = "options kvm_amd nested=1";
|
||||||
@@ -57,9 +49,7 @@
|
|||||||
};
|
};
|
||||||
gitea-runner = {
|
gitea-runner = {
|
||||||
enable = true;
|
enable = true;
|
||||||
labels = [ "self-hosted" "bare-metal" "host:isaiah" ];
|
extraLabels = [ "bare-metal:host" ];
|
||||||
# TODO: Greg add agenix secret at secrets/gitea-runner-isaiah.age
|
|
||||||
# tokenFile = config.age.secrets.gitea-runner-isaiah.path;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -75,41 +65,6 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
gitea-actions-runner.instances.podman = {
|
|
||||||
enable = true;
|
|
||||||
labels = [
|
|
||||||
"debian-latest:docker://node:25-trixie"
|
|
||||||
|
|
||||||
"ubuntu-latest:docker://docker.gitea.com/runner-images:ubuntu-latest"
|
|
||||||
"ubuntu-24.04:docker://docker.gitea.com/runner-images:ubuntu-24.04"
|
|
||||||
"ubuntu-22.04:docker://docker.gitea.com/runner-images:ubuntu-22.04"
|
|
||||||
|
|
||||||
"ubuntu-full-latest:docker://ghcr.io/catthehacker/ubuntu:full-latest"
|
|
||||||
"ubuntu-full-24.04:docker://ghcr.io/catthehacker/ubuntu:full-24.04"
|
|
||||||
"ubuntu-full-22.04:docker://ghcr.io/catthehacker/ubuntu:full-22.04"
|
|
||||||
|
|
||||||
"ubuntu-act-latest:docker://ghcr.io/catthehacker/ubuntu:act-latest"
|
|
||||||
"ubuntu-act-24.04:docker://ghcr.io/catthehacker/ubuntu:act-24.04"
|
|
||||||
"ubuntu-act-22.04:docker://ghcr.io/catthehacker/ubuntu:act-22.04"
|
|
||||||
|
|
||||||
"ubuntu-runner-latest:docker://ghcr.io/catthehacker/ubuntu:runner-latest"
|
|
||||||
"ubuntu-runner-24.04:docker://ghcr.io/catthehacker/ubuntu:runner-24.04"
|
|
||||||
"ubuntu-runner-22.04:docker://ghcr.io/catthehacker/ubuntu:runner-22.04"
|
|
||||||
|
|
||||||
"ubuntu-rust-latest:docker://ghcr.io/catthehacker/ubuntu:rust-latest"
|
|
||||||
"ubuntu-rust-24.04:docker://ghcr.io/catthehacker/ubuntu:rust-24.04"
|
|
||||||
"ubuntu-rust-22.04:docker://ghcr.io/catthehacker/ubuntu:rust-22.04"
|
|
||||||
|
|
||||||
"nix-latest:docker://src.thehellings.com/greg/builder:latest"
|
|
||||||
];
|
|
||||||
name = "isaiah-podman";
|
|
||||||
settings = {
|
|
||||||
container.force_pull = true;
|
|
||||||
runner.capacity = 7;
|
|
||||||
};
|
|
||||||
tokenFile = config.age.secrets.gitea-runner-isaiah-podman.path;
|
|
||||||
url = "https://gitea.shire-zebra.ts.net";
|
|
||||||
};
|
|
||||||
k3s.clusterInit = true; # This is the first node in the cluster
|
k3s.clusterInit = true; # This is the first node in the cluster
|
||||||
openssh = {
|
openssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -29,8 +29,6 @@ in
|
|||||||
gitea-oauthSecret = mk ../../../secrets/gitea/oauthSecret.age;
|
gitea-oauthSecret = mk ../../../secrets/gitea/oauthSecret.age;
|
||||||
gitea-webhookSecret = mk ../../../secrets/gitea/webhookSecret.age;
|
gitea-webhookSecret = mk ../../../secrets/gitea/webhookSecret.age;
|
||||||
gitea-workerPassword = mk ../../../secrets/gitea/workerPassword.age;
|
gitea-workerPassword = mk ../../../secrets/gitea/workerPassword.age;
|
||||||
# TODO: Greg add agenix secret at secrets/gitea-runner-jeremiah.age
|
|
||||||
# gitea-runner-jeremiah.file = ../../../secrets/gitea-runner-jeremiah.age;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Bootloader.
|
# Bootloader.
|
||||||
@@ -80,6 +78,10 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
greg = {
|
greg = {
|
||||||
|
gitea-runner = {
|
||||||
|
enable = true;
|
||||||
|
extraLabels = [ "bare-metal:host" ];
|
||||||
|
};
|
||||||
home = true;
|
home = true;
|
||||||
kubernetes = {
|
kubernetes = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -98,12 +100,6 @@ in
|
|||||||
threads = 3;
|
threads = 3;
|
||||||
qemu = true;
|
qemu = true;
|
||||||
};
|
};
|
||||||
gitea-runner = {
|
|
||||||
enable = true;
|
|
||||||
labels = [ "self-hosted" "bare-metal" "host:jeremiah" ];
|
|
||||||
# TODO: Greg add agenix secret at secrets/gitea-runner-jeremiah.age
|
|
||||||
# tokenFile = config.age.secrets.gitea-runner-jeremiah.path;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
hardware = {
|
hardware = {
|
||||||
|
|||||||
@@ -23,12 +23,14 @@
|
|||||||
pgloader
|
pgloader
|
||||||
];
|
];
|
||||||
|
|
||||||
age.secrets = {
|
|
||||||
# TODO: Greg add agenix secret at secrets/gitea-runner-linode.age
|
|
||||||
# gitea-runner-linode.file = ../../../secrets/gitea-runner-linode.age;
|
|
||||||
};
|
|
||||||
|
|
||||||
greg = {
|
greg = {
|
||||||
|
gitea-runner = {
|
||||||
|
enable = true;
|
||||||
|
extraLabels = [
|
||||||
|
"vps:host"
|
||||||
|
"blog:host"
|
||||||
|
];
|
||||||
|
};
|
||||||
home = false;
|
home = false;
|
||||||
linode.enable = true;
|
linode.enable = true;
|
||||||
nebula = {
|
nebula = {
|
||||||
@@ -41,12 +43,6 @@
|
|||||||
ssl = true;
|
ssl = true;
|
||||||
};
|
};
|
||||||
tailscale.enable = true;
|
tailscale.enable = true;
|
||||||
gitea-runner = {
|
|
||||||
enable = true;
|
|
||||||
labels = [ "self-hosted" "host:linode" ];
|
|
||||||
# TODO: Greg add agenix secret at secrets/gitea-runner-linode.age
|
|
||||||
# tokenFile = config.age.secrets.gitea-runner-linode.path;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
|
|||||||
@@ -14,15 +14,13 @@
|
|||||||
top.nix-hardware.nixosModules.system76
|
top.nix-hardware.nixosModules.system76
|
||||||
];
|
];
|
||||||
|
|
||||||
age.secrets = {
|
|
||||||
gitea-workerPassword.file = ../../../secrets/gitea/workerPassword.age;
|
|
||||||
# TODO: Greg add agenix secret at secrets/gitea-runner-zeke.age
|
|
||||||
# gitea-runner-zeke.file = ../../../secrets/gitea-runner-zeke.age;
|
|
||||||
};
|
|
||||||
|
|
||||||
boot.extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ];
|
boot.extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ];
|
||||||
|
|
||||||
greg = {
|
greg = {
|
||||||
|
gitea-runner = {
|
||||||
|
enable = true;
|
||||||
|
extraLabels = [ "bare-metal:host" ];
|
||||||
|
};
|
||||||
kubernetes = {
|
kubernetes = {
|
||||||
enable = true;
|
enable = true;
|
||||||
vipInterface = "enp12s0";
|
vipInterface = "enp12s0";
|
||||||
@@ -34,12 +32,6 @@
|
|||||||
enable = true;
|
enable = true;
|
||||||
vbox = false;
|
vbox = false;
|
||||||
};
|
};
|
||||||
gitea-runner = {
|
|
||||||
enable = true;
|
|
||||||
labels = [ "self-hosted" "bare-metal" "host:zeke" ];
|
|
||||||
# TODO: Greg add agenix secret at secrets/gitea-runner-zeke.age
|
|
||||||
# tokenFile = config.age.secrets.gitea-runner-zeke.path;
|
|
||||||
};
|
|
||||||
tailscale = {
|
tailscale = {
|
||||||
enable = true;
|
enable = true;
|
||||||
tags = [ "home" ];
|
tags = [ "home" ];
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.greg.gitea-runner;
|
cfg = config.greg.gitea-runner;
|
||||||
|
host = config.networking.hostName;
|
||||||
|
labels = cfg.labels ++ cfg.extraLabels;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.greg.gitea-runner = {
|
options.greg.gitea-runner = {
|
||||||
@@ -23,26 +25,80 @@ in
|
|||||||
description = "Name of the runner (defaults to hostname)";
|
description = "Name of the runner (defaults to hostname)";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
capacity = lib.mkOption {
|
||||||
|
type = lib.types.int;
|
||||||
|
default = 5;
|
||||||
|
description = "Number of concurrent jobs the runner can handle";
|
||||||
|
};
|
||||||
|
|
||||||
|
extraLabels = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.str;
|
||||||
|
default = [ ];
|
||||||
|
};
|
||||||
|
|
||||||
labels = lib.mkOption {
|
labels = lib.mkOption {
|
||||||
type = lib.types.listOf lib.types.str;
|
type = lib.types.listOf lib.types.str;
|
||||||
default = [ "self-hosted" ];
|
default = [
|
||||||
|
"self-hosted:host"
|
||||||
|
"nixos-${host}:host"
|
||||||
|
|
||||||
|
"debian-latest:docker://node:25-trixie"
|
||||||
|
|
||||||
|
"ubuntu-latest:docker://docker.gitea.com/runner-images:ubuntu-latest"
|
||||||
|
"ubuntu-24.04:docker://docker.gitea.com/runner-images:ubuntu-24.04"
|
||||||
|
"ubuntu-22.04:docker://docker.gitea.com/runner-images:ubuntu-22.04"
|
||||||
|
|
||||||
|
"ubuntu-full-latest:docker://ghcr.io/catthehacker/ubuntu:full-latest"
|
||||||
|
"ubuntu-full-24.04:docker://ghcr.io/catthehacker/ubuntu:full-24.04"
|
||||||
|
"ubuntu-full-22.04:docker://ghcr.io/catthehacker/ubuntu:full-22.04"
|
||||||
|
|
||||||
|
"ubuntu-act-latest:docker://ghcr.io/catthehacker/ubuntu:act-latest"
|
||||||
|
"ubuntu-act-24.04:docker://ghcr.io/catthehacker/ubuntu:act-24.04"
|
||||||
|
"ubuntu-act-22.04:docker://ghcr.io/catthehacker/ubuntu:act-22.04"
|
||||||
|
|
||||||
|
"ubuntu-runner-latest:docker://ghcr.io/catthehacker/ubuntu:runner-latest"
|
||||||
|
"ubuntu-runner-24.04:docker://ghcr.io/catthehacker/ubuntu:runner-24.04"
|
||||||
|
"ubuntu-runner-22.04:docker://ghcr.io/catthehacker/ubuntu:runner-22.04"
|
||||||
|
|
||||||
|
"ubuntu-rust-latest:docker://ghcr.io/catthehacker/ubuntu:rust-latest"
|
||||||
|
"ubuntu-rust-24.04:docker://ghcr.io/catthehacker/ubuntu:rust-24.04"
|
||||||
|
"ubuntu-rust-22.04:docker://ghcr.io/catthehacker/ubuntu:rust-22.04"
|
||||||
|
|
||||||
|
"nix-latest:docker://src.thehellings.com/greg/builder:latest"
|
||||||
|
];
|
||||||
description = "Labels to assign to this runner";
|
description = "Labels to assign to this runner";
|
||||||
};
|
};
|
||||||
|
|
||||||
tokenFile = lib.mkOption {
|
tokenFile = lib.mkOption {
|
||||||
type = lib.types.path;
|
type = lib.types.path;
|
||||||
description = "Path to a file containing the runner registration token (from agenix)";
|
description = "Path to a file containing the runner registration token (from agenix)";
|
||||||
|
default = ../../secrets/gitea/runner-isaiah-podman.age;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
age.secrets."gitea-runner-${host}-podman".file = cfg.tokenFile;
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
bash
|
||||||
|
git
|
||||||
|
nodejs
|
||||||
|
];
|
||||||
|
|
||||||
|
greg.podman.enable = true;
|
||||||
|
|
||||||
services.gitea-actions-runner = {
|
services.gitea-actions-runner = {
|
||||||
package = pkgs.gitea-actions-runner;
|
package = pkgs.gitea-actions-runner;
|
||||||
instances.${cfg.name} = {
|
instances.${cfg.name} = {
|
||||||
|
inherit labels;
|
||||||
|
inherit (cfg) name;
|
||||||
enable = true;
|
enable = true;
|
||||||
url = cfg.instanceURL;
|
url = cfg.instanceURL;
|
||||||
tokenFile = cfg.tokenFile;
|
tokenFile = config.age.secrets."gitea-runner-${host}-podman".path;
|
||||||
labels = cfg.labels;
|
settings = {
|
||||||
|
container.force_pull = true;
|
||||||
|
runner.capacity = cfg.capacity;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Binary file not shown.
+1
-1
@@ -100,7 +100,7 @@ in
|
|||||||
"gitea/oauthToken.age".publicKeys = everyone;
|
"gitea/oauthToken.age".publicKeys = everyone;
|
||||||
"gitea/webhookSecret.age".publicKeys = everyone;
|
"gitea/webhookSecret.age".publicKeys = everyone;
|
||||||
"gitea/workerPassword.age".publicKeys = everyone;
|
"gitea/workerPassword.age".publicKeys = everyone;
|
||||||
"gitea/runner-podman-isaiah.age".publicKeys = users ++ [ hosts.isaiah.pubkey ];
|
"gitea/runner-isaiah-podman.age".publicKeys = everyone;
|
||||||
|
|
||||||
"gitlab/secret.age".publicKeys = everyone;
|
"gitlab/secret.age".publicKeys = everyone;
|
||||||
"gitlab/otp.age".publicKeys = everyone;
|
"gitlab/otp.age".publicKeys = everyone;
|
||||||
|
|||||||
Reference in New Issue
Block a user