From a099bfcf34da5b75eaf4bf03dd92d7cdde2253ca Mon Sep 17 00:00:00 2001 From: Tasia Iso Date: Thu, 3 Oct 2024 13:11:58 +0200 Subject: [PATCH] forgejo --- hosts/vulpecula/configuration.nix | 53 ++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 5 deletions(-) diff --git a/hosts/vulpecula/configuration.nix b/hosts/vulpecula/configuration.nix index a5520e6..1edc9be 100644 --- a/hosts/vulpecula/configuration.nix +++ b/hosts/vulpecula/configuration.nix @@ -49,11 +49,21 @@ in { ]; }; - services.nginx.enable = true; - services.nginx.virtualHosts."vulpecula.zone" = { - addSSL = true; - enableACME = true; - root = "/www"; + services.nginx = { + enable = true; + + virtualHosts."vulpecula.zone" = { + addSSL = true; + enableACME = true; + root = "/www"; + }; + virtualHosts."git.vulpecula.zone" = { + addSSL = true; + enableACME = true; + locations."/".proxyPass = "http://localhost:${toString config.services.forgejo.settings.HTTP_PORT}"; + }; + + }; security.acme = { @@ -61,6 +71,39 @@ in { defaults.email = "tasiaiso@proton.me"; }; + services.forgejo = { + enable = true; + database.type = "postgres"; + # Enable support for Git Large File Storage + lfs.enable = true; + settings = { + server = { + DOMAIN = "git.vulpecula.zone"; + # You need to specify this to remove the port from URLs in the web UI. + ROOT_URL = "https://git.vulpecula.zone/"; + HTTP_PORT = 62101; + }; + # You can temporarily allow registration to create an admin user. + service.DISABLE_REGISTRATION = false; + # Add support for actions, based on act: https://github.com/nektos/act + # actions = { + # ENABLED = true; + # DEFAULT_ACTIONS_URL = "github"; + # }; + # Sending emails is completely optional + # You can send a test email from the web UI at: + # Profile Picture > Site Administration > Configuration > Mailer Configuration + # mailer = { + # ENABLED = true; + # SMTP_ADDR = "mail.example.com"; + # FROM = "noreply@${srv.DOMAIN}"; + # USER = "noreply@${srv.DOMAIN}"; + # }; + }; + # mailerPasswordFile = config.age.secrets.forgejo-mailer-password.path; + }; + + boot.tmp.cleanOnBoot = true; zramSwap.enable = true; networking.domain = "";