From 729050b005629c3bf7eb6ede74267042e1189406 Mon Sep 17 00:00:00 2001 From: harry123 Date: Thu, 12 Dec 2024 15:09:03 +0100 Subject: [PATCH] added forgejo runner support --- features/server/services/forgejo.nix | 26 +++++++++++++++++++++++++- overlays/ircd-hybrid.nix | 9 +++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 overlays/ircd-hybrid.nix diff --git a/features/server/services/forgejo.nix b/features/server/services/forgejo.nix index 69362c5..30aa92b 100644 --- a/features/server/services/forgejo.nix +++ b/features/server/services/forgejo.nix @@ -1,4 +1,4 @@ -{ config, lib, ... }: +{ config, lib, pkgs, ... }: { imports = [ ./forgejo-smtp.nix ]; sops.secrets.smtp_address = { }; @@ -36,6 +36,30 @@ mailerPasswordFile = config.sops.secrets.smtp_password.path; }; + sops.secrets.forgejo-runner-token = { + owner = "forgejo"; + }; + + services.gitea-actions-runner = { + package = pkgs.forgejo-actions-runner; + instances.default = { + enable = true; + name = "monolith"; + url = "https://git.hypervirtual.world"; + # Obtaining the path to the runner token file may differ + # tokenFile should be in format TOKEN=, since it's EnvironmentFile for systemd + tokenFile = config.sops.secrets.forgejo-runner-token.path; + labels = [ + "ubuntu-latest:docker://node:16-bullseye" + "ubuntu-22.04:docker://node:16-bullseye" + ## optionally provide native execution on the host: + # "native:host" + ]; + }; + }; + + }; + systemd.services.forgejo.preStart = '' create="${lib.getExe config.services.forgejo.package} admin user create" $create --admin --email "`cat ${config.sops.secrets.forgejoInitialMail.path}`" --username you --password "`cat ${config.sops.secrets.forgejoInitialPassword.path}`" &>/dev/null || true diff --git a/overlays/ircd-hybrid.nix b/overlays/ircd-hybrid.nix new file mode 100644 index 0000000..e29d883 --- /dev/null +++ b/overlays/ircd-hybrid.nix @@ -0,0 +1,9 @@ +{config, ...}: { + + nixpkgs.overlays = [ + (self: super: { + ircdHybrid + }) + ]; + +}