From 0e4a2c5b9dc9b6707c7fbe1a061c4cfd0fb06359 Mon Sep 17 00:00:00 2001 From: Chandler Swift Date: Tue, 5 Nov 2024 23:47:48 -0600 Subject: [PATCH] Add forgejo --- bert/configuration.nix | 1 + bert/services/forgejo.nix | 19 +++++++++++++++++++ bert/services/http/git.chandlerswift.com.nix | 5 +++++ bert/services/http/index.nix | 1 + 4 files changed, 26 insertions(+) create mode 100644 bert/services/forgejo.nix create mode 100644 bert/services/http/git.chandlerswift.com.nix diff --git a/bert/configuration.nix b/bert/configuration.nix index 2251ddd..f9a6c33 100644 --- a/bert/configuration.nix +++ b/bert/configuration.nix @@ -7,6 +7,7 @@ ./services/factorio.nix ./services/http/index.nix ./services/monitoring.nix + ./services/forgejo.nix ]; # Bootloader diff --git a/bert/services/forgejo.nix b/bert/services/forgejo.nix new file mode 100644 index 0000000..9d7d619 --- /dev/null +++ b/bert/services/forgejo.nix @@ -0,0 +1,19 @@ +{ + services.forgejo = { + enable = true; + settings = { + DEFAULT = { + APP_NAME = "Forgejo: Beyond coding. We Forge."; # TODO + }; + server = { + # USE_PROXY_PROTOCOL = true; + DOMAIN = "git.chandlerswift.com"; + #SSH_DOMAIN = "git.chandlerswift.com"; + ROOT_URL = "https://git.chandlerswift.com/"; + HTTP_PORT = 3001; + LANDING_PAGE = "/chandlerswift"; + }; + service.DISABLE_REGISTRATION = true; + }; + }; +} diff --git a/bert/services/http/git.chandlerswift.com.nix b/bert/services/http/git.chandlerswift.com.nix new file mode 100644 index 0000000..609c95f --- /dev/null +++ b/bert/services/http/git.chandlerswift.com.nix @@ -0,0 +1,5 @@ +{config, ...}: { + services.caddy.virtualHosts."git.chandlerswift.com".extraConfig = '' + reverse_proxy localhost:${toString config.services.forgejo.settings.server.HTTP_PORT} + ''; +} diff --git a/bert/services/http/index.nix b/bert/services/http/index.nix index 6b0430a..51e12c7 100644 --- a/bert/services/http/index.nix +++ b/bert/services/http/index.nix @@ -1,6 +1,7 @@ { imports = [ ./files.chandlerswift.com.nix + ./git.chandlerswift.com.nix ./home.chandlerswift.com.nix ./maps.chandlerswift.com.nix ./stjohnscccc.org.nix