From 4d84ef14b603b631655f9abbd36ee79cd7c15cf6 Mon Sep 17 00:00:00 2001 From: Ahwx Date: Thu, 24 Apr 2025 15:02:32 +0200 Subject: [PATCH] chore: adds sample code for when i finally add ci/cd --- modules/services/forgejo.nix | 38 ++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/modules/services/forgejo.nix b/modules/services/forgejo.nix index ef9fde9..52e94bc 100644 --- a/modules/services/forgejo.nix +++ b/modules/services/forgejo.nix @@ -1,4 +1,9 @@ -{ lib, pkgs, config, ... }: +{ + lib, + pkgs, + config, + ... +}: let cfg = config.services.forgejo; srv = cfg.settings.server; @@ -13,11 +18,11 @@ in server = { DOMAIN = "code.liv.town"; # You need to specify this to remove the port from URLs in the web UI. - ROOT_URL = "https://${srv.DOMAIN}/"; + ROOT_URL = "https://${srv.DOMAIN}/"; HTTP_PORT = 3050; }; # You can temporarily allow registration to create an admin user. - service.DISABLE_REGISTRATION = true; + service.DISABLE_REGISTRATION = true; # Add support for actions, based on act: https://github.com/nektos/act actions = { ENABLED = true; @@ -25,7 +30,7 @@ in }; # Sending emails is completely optional # You can send a test email from the web UI at: - # Profile Picture > Site Administration > Configuration > Mailer Configuration + # Profile Picture > Site Administration > Configuration > Mailer Configuration # mailer = { # ENABLED = true; # SMTP_ADDR = "mail.example.com"; @@ -35,6 +40,19 @@ in }; # mailerPasswordFile = config.age.secrets.forgejo-mailer-password.path; }; + # gitea-actions-runner = { + # package = pkgs.forgejo-runner; + # instances.my-forgejo-instance = { + # enable = true; + # name = "forgejo-01"; + # token = ""; # TODO: fill in tokens etc + # url = "https://code.liv.town"; + # labels = [ + # "node-22:docker://node:22-bookworm" + # "nixos-latest:docker://nixos/nix" + # ]; + # }; + # }; services = { nginx.virtualHosts."code.liv.town" = { forceSSL = true; @@ -46,10 +64,10 @@ in }; }; }; - # systemd.services.forgejo.preStart = let - # adminCmd = "${lib.getExe cfg.package} admin user"; - # user = "liv"; - # in '' - # ${adminCmd} create --admin --email "liv@liv.town" --username ${user} --password "boopbeepboop123123123" || true - # ''; + # systemd.services.forgejo.preStart = let + # adminCmd = "${lib.getExe cfg.package} admin user"; + # user = "liv"; + # in '' + # ${adminCmd} create --admin --email "liv@liv.town" --username ${user} --password "boopbeepboop123123123" || true + # ''; }