repo hygiene: move secrets to pass; add examples; misc updates

This commit is contained in:
2026-02-18 01:37:46 -08:00
committed by Kat Huang
parent a5f3ffc21b
commit 6f4c5e120d
15 changed files with 145 additions and 173 deletions

View File

@@ -49,7 +49,9 @@
enable = true;
name = config.networking.hostName;
url = "https://dev.railbird.ai";
token = "H0A7YXAWsKSp9QzvMymfJI12hbxwR7UerEHpCJUe";
# Keep the runner registration token out of git.
# Create this file on the machine before the runner is (re)registered.
tokenFile = "/var/lib/gitea-runner/nix/token";
labels = [
"nix-darwin-${pkgs.system}:host"
"macos-aarch64-darwin"

View File

@@ -18,6 +18,10 @@ with lib; let
tokenXorTokenFile = instance:
(instance.token == null && instance.tokenFile != null)
|| (instance.token != null && instance.tokenFile == null);
# Render a tokenFile (path or string) into the shell snippet used by launchd.
tokenFilePath = instance:
if instance.tokenFile == null then null else toString instance.tokenFile;
in {
options.services.gitea-actions-runner = {
package = mkOption {
@@ -154,6 +158,11 @@ in {
"${pkgs.writeShellScript "gitea-runner-setup-${name}" ''
mkdir -p /var/lib/gitea-runner/${name}
cd /var/lib/gitea-runner/${name}
${
if instance.tokenFile != null then ''
TOKEN="$(${pkgs.coreutils}/bin/cat ${escapeShellArg (tokenFilePath instance)})"
'' else ""
}
if [ ! -e "/var/lib/gitea-runner/${name}/.runner" ]; then
${cfg.package}/bin/act_runner register --no-interactive \
--instance ${escapeShellArg instance.url} \