Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
84d050fb0c | ||
|
|
3847c7d92d | ||
|
|
81936ac524 |
@@ -9,12 +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;
|
|
||||||
};
|
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
binfmt.emulatedSystems = [ "aarch64-linux" ];
|
binfmt.emulatedSystems = [ "aarch64-linux" ];
|
||||||
extraModprobeConfig = "options kvm_amd nested=1";
|
extraModprobeConfig = "options kvm_amd nested=1";
|
||||||
@@ -53,6 +47,10 @@
|
|||||||
enable = true;
|
enable = true;
|
||||||
qemu = true;
|
qemu = true;
|
||||||
};
|
};
|
||||||
|
gitea-runner = {
|
||||||
|
enable = true;
|
||||||
|
extraLabels = [ "bare-metal:host" ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
@@ -67,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;
|
||||||
|
|||||||
@@ -78,6 +78,10 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
greg = {
|
greg = {
|
||||||
|
gitea-runner = {
|
||||||
|
enable = true;
|
||||||
|
extraLabels = [ "bare-metal:host" ];
|
||||||
|
};
|
||||||
home = true;
|
home = true;
|
||||||
kubernetes = {
|
kubernetes = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -24,6 +24,13 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
greg = {
|
greg = {
|
||||||
|
gitea-runner = {
|
||||||
|
enable = true;
|
||||||
|
extraLabels = [
|
||||||
|
"vps:host"
|
||||||
|
"blog:host"
|
||||||
|
];
|
||||||
|
};
|
||||||
home = false;
|
home = false;
|
||||||
linode.enable = true;
|
linode.enable = true;
|
||||||
nebula = {
|
nebula = {
|
||||||
|
|||||||
@@ -14,13 +14,13 @@
|
|||||||
top.nix-hardware.nixosModules.system76
|
top.nix-hardware.nixosModules.system76
|
||||||
];
|
];
|
||||||
|
|
||||||
age.secrets = {
|
|
||||||
gitea-workerPassword.file = ../../../secrets/gitea/workerPassword.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";
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ spec:
|
|||||||
- /bin/sh
|
- /bin/sh
|
||||||
- "-c"
|
- "-c"
|
||||||
- >-
|
- >-
|
||||||
|
rm -r /staging/*;
|
||||||
immich-go
|
immich-go
|
||||||
archive
|
archive
|
||||||
"--write-to-folder"
|
"--write-to-folder"
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
./backup.nix
|
./backup.nix
|
||||||
./ceph.nix
|
./ceph.nix
|
||||||
./db.nix
|
./db.nix
|
||||||
|
./gitea-runner.nix
|
||||||
./gitlab-runner.nix
|
./gitlab-runner.nix
|
||||||
./gnome.nix
|
./gnome.nix
|
||||||
./home.nix
|
./home.nix
|
||||||
|
|||||||
@@ -6,58 +6,98 @@
|
|||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.greg.gitea-runner;
|
cfg = config.greg.gitea-runner;
|
||||||
hostname = config.networking.hostName;
|
host = config.networking.hostName;
|
||||||
|
labels = cfg.labels ++ cfg.extraLabels;
|
||||||
# Determine extra labels based on host role
|
|
||||||
roleLabels =
|
|
||||||
if builtins.elem hostname [ "isaiah" "jeremiah" "zeke" ] then
|
|
||||||
[ "bare-metal" ]
|
|
||||||
else if hostname == "linode" then
|
|
||||||
[ "linode" ]
|
|
||||||
else
|
|
||||||
[ ];
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.greg.gitea-runner = {
|
options.greg.gitea-runner = {
|
||||||
enable = lib.mkEnableOption "Enable Gitea Actions runner (exec/shell mode)";
|
enable = lib.mkEnableOption "Enable Gitea act_runner (shell mode)";
|
||||||
|
|
||||||
hostnameLabel = lib.mkOption {
|
instanceURL = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "https://src.thehellings.com";
|
||||||
|
description = "URL of the Gitea instance to connect to";
|
||||||
|
};
|
||||||
|
|
||||||
|
name = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = config.networking.hostName;
|
default = config.networking.hostName;
|
||||||
description = "Label identifying this host in the runner pool (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 {
|
||||||
|
type = lib.types.listOf lib.types.str;
|
||||||
|
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";
|
||||||
};
|
};
|
||||||
|
|
||||||
tokenFile = lib.mkOption {
|
tokenFile = lib.mkOption {
|
||||||
type = lib.types.path;
|
type = lib.types.path;
|
||||||
description = ''
|
description = "Path to a file containing the runner registration token (from agenix)";
|
||||||
Path to the file containing the runner registration token.
|
default = ../../secrets/gitea/runner-isaiah-podman.age;
|
||||||
Wire in your agenix secret path here, e.g.:
|
|
||||||
config.age.secrets.gitea-runner-token.path
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
threads = lib.mkOption {
|
|
||||||
type = lib.types.int;
|
|
||||||
default = 4;
|
|
||||||
description = "Maximum number of concurrent jobs";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
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.${hostname} = {
|
instances.${cfg.name} = {
|
||||||
|
inherit labels;
|
||||||
|
inherit (cfg) name;
|
||||||
enable = true;
|
enable = true;
|
||||||
url = "https://src.thehellings.com";
|
url = cfg.instanceURL;
|
||||||
tokenFile = cfg.tokenFile;
|
tokenFile = config.age.secrets."gitea-runner-${host}-podman".path;
|
||||||
labels =
|
|
||||||
[
|
|
||||||
"self-hosted"
|
|
||||||
cfg.hostnameLabel
|
|
||||||
]
|
|
||||||
++ roleLabels;
|
|
||||||
settings = {
|
settings = {
|
||||||
runner.capacity = cfg.threads;
|
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