15 Commits
Author SHA1 Message Date
klaatu 81936ac524 feat: Gitea Actions shell runners + flake-lock workflow
buildbot/nix-eval Build done.
buildbot/nix-build gitea:greg/nixos#checks.x86_64-linux.nixos-linode Build done.
buildbot/nix-build gitea:greg/nixos#checks.x86_64-linux.nixos-isaiah Build done.
buildbot/nix-build gitea:greg/nixos#checks.x86_64-linux.nixos-jeremiah Build done.
buildbot/nix-build gitea:greg/nixos#checks.x86_64-linux.nixos-zeke Build done.
buildbot/nix-build Build done.
- Add modules/nixos/gitea-runner.nix: NixOS module for act_runner in
  shell mode, with options for enable, instanceURL, name, labels, and
  tokenFile (agenix secret path).
- Deploy gitea-runner to jeremiah, isaiah, zeke, and linode with
  appropriate labels. Agenix secret placeholders left with TODOs.
- Add .gitea/workflows/update-flake-lock.yaml: weekly workflow (Sunday
  midnight) that runs nix flake update and opens a PR if flake.lock
  changed, using GITEA_TOKEN secret for authentication.

Closes part of #15 (NixOS shell runners + flake-lock workflow).
2026-04-05 04:58:27 -05:00
Greg Hellings 45d8154a04 Merge remote-tracking branch 'origin/feat/gitea-actions'
buildbot/nix-eval Build done. (1 warning)
buildbot/nix-build Build done.
buildbot/nix-effects Build done.
Update flake.lock / update-flake-lock (push) Has been cancelled
2026-04-04 14:18:22 -05:00
Greg Hellings 03400f1c93 fix: pull correct secrets 2026-04-04 14:14:23 -05:00
greg 603598a3f9 Merge branch 'main' into feat/gitea-actions
buildbot/nix-eval Build done. (1 warning)
buildbot/nix-build Build done.
2026-04-04 19:13:31 +00:00
klaatu 757b07c22f fix: replace placeholder Secret with ExternalSecret via bitwarden-login
buildbot/nix-eval Build done. (1 warning)
buildbot/nix-build Build done.
2026-04-04 19:05:17 +00:00
klaatu b7fba0e151 fix: chart name act_runner -> actions, version 0.2.5 -> 0.0.4 2026-04-04 19:05:06 +00:00
greg 75278cdb6a Merge pull request 'fix: set MC_CONFIG_DIR to /tmp/.mc so mc can write config as non-root' (#20) from klaatu/nixos:fix/mc-config-dir into main
buildbot/nix-eval Build done. (1 warning)
buildbot/nix-build Build done.
buildbot/nix-effects Build done.
Reviewed-on: https://src.thehellings.com/greg/nixos/pulls/20
Reviewed-by: greg <gitea@local.domain>
2026-04-04 18:23:42 +00:00
klaatu 67f12856e1 fix: set MC_CONFIG_DIR to /tmp/.mc so mc can write config as non-root
buildbot/nix-eval Build done. (1 warning)
buildbot/nix-build Build done.
2026-04-04 18:18:43 +00:00
klaatu 2741be72c7 feat: add update-manifests workflow
buildbot/nix-eval Build done. (1 warning)
buildbot/nix-build Build done.
2026-04-04 06:18:14 +00:00
klaatu e8beb7f2a9 feat: add update-flake-lock workflow 2026-04-04 06:18:12 +00:00
klaatu b2728bf1de feat: add gitea-runner NixOS module 2026-04-04 06:18:10 +00:00
klaatu d65dcb51a3 feat: add gitea-runner secret placeholder 2026-04-04 06:18:07 +00:00
klaatu 87bc9a21d9 feat: add gitea-runner kustomization 2026-04-04 06:18:04 +00:00
klaatu ca25dde780 feat: add gitea-runner FluxCD HelmRelease 2026-04-04 06:18:01 +00:00
klaatu c61900f9e6 feat: add gitea-runner namespace manifest 2026-04-04 06:17:59 +00:00
15 changed files with 294 additions and 4 deletions
+51
View File
@@ -0,0 +1,51 @@
name: Update flake.lock
on:
schedule:
- cron: "0 0 * * 0" # Every Sunday at midnight UTC
workflow_dispatch:
jobs:
update-flake-lock:
runs-on: [self-hosted, nix]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update flake.lock
run: nix flake update
- name: Create PR if changed
env:
GITEA_TOKEN: ${{ secrets.KLAATU_TOKEN }}
GITEA_URL: https://src.thehellings.com
REPO: greg/nixos
run: |
if git diff --quiet flake.lock; then
echo "flake.lock unchanged, nothing to do"
exit 0
fi
BRANCH="auto/update-flake-lock-$(date +%Y%m%d)"
git config user.email "klaatu@thehellings.com"
git config user.name "klaatu"
git checkout -b "$BRANCH"
git add flake.lock
git commit -m "chore: update flake.lock $(date +%Y-%m-%d)"
# Push branch using token auth
git remote set-url origin "https://klaatu:${GITEA_TOKEN}@${GITEA_URL#https://}/${REPO}.git"
git push origin "$BRANCH"
# Create PR via Gitea API
curl -s -X POST \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
"${GITEA_URL}/api/v1/repos/${REPO}/pulls" \
-d "{
\"title\": \"chore: update flake.lock $(date +%Y-%m-%d)\",
\"head\": \"$BRANCH\",
\"base\": \"main\",
\"body\": \"Automated weekly flake.lock update.\\n\\nGenerated by Gitea Actions.\",
\"assignees\": [\"greg\"]
}"
+58
View File
@@ -0,0 +1,58 @@
name: Update manifest chart versions
on:
schedule:
- cron: "0 0 * * 1" # Every Monday at midnight UTC
workflow_dispatch:
jobs:
update-manifests:
runs-on: [self-hosted, nix]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Scan manifests for chart version updates
run: |
echo "TODO: implement manifest update scanning"
echo ""
echo "Planned implementation:"
echo " 1. Parse each manifests/*/chart.yaml for HelmRelease chart versions"
echo " 2. Query artifact hub or helm repo for latest versions"
echo " 3. Emit a diff of available updates"
echo ""
echo "Scanned manifests directories:"
ls manifests/
- name: Create PR if changes found
env:
GITEA_TOKEN: ${{ secrets.KLAATU_TOKEN }}
GITEA_URL: https://src.thehellings.com
REPO: greg/nixos
run: |
if git diff --quiet; then
echo "No manifest changes, nothing to do"
exit 0
fi
BRANCH="auto/update-manifests-$(date +%Y%m%d)"
git config user.email "klaatu@thehellings.com"
git config user.name "klaatu"
git checkout -b "$BRANCH"
git add manifests/
git commit -m "chore: update manifest chart versions $(date +%Y-%m-%d)"
git remote set-url origin "https://klaatu:${GITEA_TOKEN}@${GITEA_URL#https://}/${REPO}.git"
git push origin "$BRANCH"
curl -s -X POST \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
"${GITEA_URL}/api/v1/repos/${REPO}/pulls" \
-d "{
\"title\": \"chore: update manifest chart versions $(date +%Y-%m-%d)\",
\"head\": \"$BRANCH\",
\"base\": \"main\",
\"body\": \"Automated weekly manifest chart version update.\\n\\nGenerated by Gitea Actions.\",
\"assignees\": [\"greg\"]
}"
+8
View File
@@ -13,6 +13,8 @@
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 = {
@@ -53,6 +55,12 @@
enable = true;
qemu = true;
};
gitea-runner = {
enable = true;
labels = [ "self-hosted" "bare-metal" "host:isaiah" ];
# TODO: Greg add agenix secret at secrets/gitea-runner-isaiah.age
# tokenFile = config.age.secrets.gitea-runner-isaiah.path;
};
};
networking = {
+8
View File
@@ -29,6 +29,8 @@ in
gitea-oauthSecret = mk ../../../secrets/gitea/oauthSecret.age;
gitea-webhookSecret = mk ../../../secrets/gitea/webhookSecret.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.
@@ -96,6 +98,12 @@ in
threads = 3;
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 = {
+11
View File
@@ -23,6 +23,11 @@
pgloader
];
age.secrets = {
# TODO: Greg add agenix secret at secrets/gitea-runner-linode.age
# gitea-runner-linode.file = ../../../secrets/gitea-runner-linode.age;
};
greg = {
home = false;
linode.enable = true;
@@ -36,6 +41,12 @@
ssl = 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 = {
+8
View File
@@ -16,6 +16,8 @@
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 ];
@@ -32,6 +34,12 @@
enable = true;
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 = {
enable = true;
tags = [ "home" ];
+56
View File
@@ -0,0 +1,56 @@
apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
metadata:
name: gitea
spec:
interval: "24h"
url: https://dl.gitea.com/charts/
---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: gitea-runner
namespace: gitea-runner
spec:
interval: 10m
chart:
spec:
chart: actions
version: "0.0.4"
sourceRef:
kind: HelmRepository
name: gitea
interval: "1h"
values:
rbac:
create: true
serviceAccount:
create: true
gitea:
instanceURL: https://src.thehellings.com
runnerToken:
existingSecret: gitea-runner
existingSecretKey: token
imagePullSecrets:
- name: image-pull-secrets
config:
runner:
labels:
# Ubuntu
- "ubuntu-22.04:docker://ubuntu:22.04"
- "ubuntu-24.04:docker://ubuntu:24.04"
- "ubuntu-24.10:docker://ubuntu:24.10"
# Fedora
- "fedora-41:docker://fedora:41"
- "fedora-42:docker://fedora:42"
# CentOS Stream
- "centos-stream-9:docker://quay.io/centos/centos:stream9"
- "centos-stream-10:docker://quay.io/centos/centos:stream10"
# Nix
- "nix:docker://nixos/nix:latest"
# ci-images (internal registry: src.thehellings.com/greg)
- "ci-builder:docker://src.thehellings.com/greg/builder:latest"
- "ci-vm-test:docker://src.thehellings.com/greg/vm-test:latest"
- "ci-sword:docker://src.thehellings.com/greg/sword-container-builder:latest"
- "ci-bitwarden:docker://src.thehellings.com/greg/bitwarden:latest"
- "ci-immich:docker://src.thehellings.com/greg/immich:latest"
@@ -0,0 +1,6 @@
namespace: gitea-runner
resources:
- namespace.yaml
- secrets.yaml
- chart.yaml
+4
View File
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: gitea-runner
+18
View File
@@ -0,0 +1,18 @@
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: gitea-runner
namespace: gitea-runner
spec:
refreshInterval: 1h
secretStoreRef:
name: bitwarden-login
kind: ClusterSecretStore
target:
name: gitea-runner
creationPolicy: Owner
data:
- secretKey: token
remoteRef:
key: 11419680-5338-4f19-bdd9-b422007046af
property: password
+3
View File
@@ -64,6 +64,8 @@ spec:
mountPath: /dump-staging
readOnly: true
env:
- name: MC_CONFIG_DIR
value: /tmp/.mc
- name: MINIO_ACCESS_KEY
valueFrom:
secretKeyRef:
@@ -74,3 +76,4 @@ spec:
secretKeyRef:
name: gitea-config
key: minio_secret
+11 -2
View File
@@ -15,8 +15,8 @@ spec:
storage: |-
MINIO_ACCESS_KEY_ID={{ .minio_key }}
MINIO_SECRET_ACCESS_KEY={{ .minio_secret }}
minio_key: "{{ .minio_key }}"
minio_secret: "{{ .minio_secret }}"
minio_key: "{{ .minio_nas1_key }}"
minio_secret: "{{ .minio_nas1_secret }}"
secretStoreRef:
name: bitwarden-login
kind: ClusterSecretStore
@@ -30,6 +30,15 @@ spec:
remoteRef:
key: dcbcf704-7dce-48d7-bbd1-b3a801875b3d
property: password
# MinIO credentials for NAS1
- secretKey: minio_nas1_key
remoteRef:
key: c4c66ab3-2ade-4086-9c0d-b3a80172b1ba
property: username
- secretKey: minio_nas1_secret
remoteRef:
key: c4c66ab3-2ade-4086-9c0d-b3a80172b1ba
property: password
# Postgres credentials
- secretKey: dbuser
remoteRef:
+2 -2
View File
@@ -46,11 +46,11 @@ spec:
data:
- secretKey: minio_key
remoteRef:
key: dcbcf704-7dce-48d7-bbd1-b3a801875b3d
key: c4c66ab3-2ade-4086-9c0d-b3a80172b1ba
property: username
- secretKey: minio_secret
remoteRef:
key: dcbcf704-7dce-48d7-bbd1-b3a801875b3d
key: c4c66ab3-2ade-4086-9c0d-b3a80172b1ba
property: password
---
apiVersion: v1
+1
View File
@@ -8,6 +8,7 @@
./backup.nix
./ceph.nix
./db.nix
./gitea-runner.nix
./gitlab-runner.nix
./gnome.nix
./home.nix
+49
View File
@@ -0,0 +1,49 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.greg.gitea-runner;
in
{
options.greg.gitea-runner = {
enable = lib.mkEnableOption "Enable Gitea act_runner (shell mode)";
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;
default = config.networking.hostName;
description = "Name of the runner (defaults to hostname)";
};
labels = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ "self-hosted" ];
description = "Labels to assign to this runner";
};
tokenFile = lib.mkOption {
type = lib.types.path;
description = "Path to a file containing the runner registration token (from agenix)";
};
};
config = lib.mkIf cfg.enable {
services.gitea-actions-runner = {
package = pkgs.gitea-actions-runner;
instances.${cfg.name} = {
enable = true;
url = cfg.instanceURL;
tokenFile = cfg.tokenFile;
labels = cfg.labels;
};
};
};
}