aboutsummaryrefslogtreecommitdiff
path: root/hosts/sagittarius
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/sagittarius')
-rw-r--r--hosts/sagittarius/web/default.nix2
-rw-r--r--hosts/sagittarius/web/git.nix39
2 files changed, 35 insertions, 6 deletions
diff --git a/hosts/sagittarius/web/default.nix b/hosts/sagittarius/web/default.nix
index 611d11b..7d049ea 100644
--- a/hosts/sagittarius/web/default.nix
+++ b/hosts/sagittarius/web/default.nix
@@ -4,6 +4,6 @@
./blog.nix
./matrix.nix
./mediadb.nix
- # ./git.nix
+ ./git.nix
];
}
diff --git a/hosts/sagittarius/web/git.nix b/hosts/sagittarius/web/git.nix
index adea3c3..a9a2e57 100644
--- a/hosts/sagittarius/web/git.nix
+++ b/hosts/sagittarius/web/git.nix
@@ -1,9 +1,38 @@
-{ ... }:
+{ config, ... }:
+let
+ cfg = config.services.forgejo;
+ srv = cfg.settings.server;
+in
{
- services.gitDaemon = {
+ services.nginx = {
enable = true;
- repositories = [ "/srv/git/" ];
- exportAll = true;
- basePath = "/srv/git/";
+ virtualHosts.${cfg.settings.server.DOMAIN} = {
+ forceSSL = true;
+ enableACME = true;
+ extraConfig = ''
+ client_max_body_size 512M;
+ '';
+ locations."/".proxyPass = "http://localhost:${toString srv.HTTP_PORT}";
+ };
+ };
+
+ services.forgejo = {
+ enable = true;
+ database.type = "postgres";
+ settings = {
+ server = {
+ DOMAIN = "git.sorre.xyz";
+ # You need to specify this to remove the port from URLs in the web UI.
+ ROOT_URL = "https://${srv.DOMAIN}/";
+ HTTP_PORT = 3000;
+ };
+ # You can temporarily allow registration to create an admin user.
+ # service.DISABLE_REGISTRATION = true;
+ # Add support for actions, based on act: https://github.com/nektos/act
+ actions = {
+ ENABLED = true;
+ DEFAULT_ACTIONS_URL = "github";
+ };
+ };
};
}