From f9aafcb959d43974869aecc568bb95e9b364ba75 Mon Sep 17 00:00:00 2001 From: 514fpv Date: Thu, 11 Jan 2024 14:29:06 +0800 Subject: [PATCH] feat(library): add act_runner instance --- spec/library/forgejo.nix | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/spec/library/forgejo.nix b/spec/library/forgejo.nix index d957c9cf..8c086e95 100644 --- a/spec/library/forgejo.nix +++ b/spec/library/forgejo.nix @@ -1,4 +1,5 @@ { pkgs +, config , ...}: let host = "src.514fpv.io"; in { @@ -30,4 +31,33 @@ in { addSSL = true; locations."/".proxyPass = "http://unix:/run/forgejo/forgejo.sock"; }; + + services.gitea-actions-runner.instances.local = { + enable = true; + url = "https://${host}:2096"; + name = config.networking.hostName; + tokenFile = "/nix/persist/secret/gitea-runner"; + labels = [ + # provide a debian base with nodejs for actions + "debian-latest:docker://node:18-bullseye" + # fake the ubuntu name, because node provides no ubuntu builds + "ubuntu-latest:docker://node:18-bullseye" + # provide native execution on the host + "native:host" + ]; + settings = { + runner.envs = let + proxy = "socks5://192.168.1.253:1080"; + in { + all_proxy = proxy; + ftp_proxy = proxy; + http_proxy = proxy; + https_proxy = proxy; + rsync_proxy = proxy; + no_proxy = "127.0.0.1,localhost,.localdomain"; + }; + }; + }; + + environment.persistence."/nix/persist/fhs".directories = [ "/var/lib/private/gitea-runner" ]; }