From 60e26854dac063f0732f44babb3c7d3dbf7888a0 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 13 Jun 2025 16:27:15 +0530 Subject: Add git + gitweb integration --- modules/network/default.nix | 1 + modules/network/service-router.service.nix | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'modules/network') diff --git a/modules/network/default.nix b/modules/network/default.nix index 6a40ef7..53e64b0 100644 --- a/modules/network/default.nix +++ b/modules/network/default.nix @@ -20,6 +20,7 @@ in "jellyfin.local" = { inherit host; port = ports.jellyfin; }; "syncthing.local" = { inherit host; port = ports.syncthing; }; "lidarr.local" = { inherit host; port = ports.lidarr; }; + "git.local" = { inherit host; port = 80; basePath = "/gitweb/"; }; }; }; diff --git a/modules/network/service-router.service.nix b/modules/network/service-router.service.nix index 9c4e6e2..3d0b6e7 100644 --- a/modules/network/service-router.service.nix +++ b/modules/network/service-router.service.nix @@ -19,6 +19,7 @@ in { port = mkOption { type = types.int; }; host = mkOption { type = types.str; default = "127.0.0.1"; }; protocol = mkOption { type = types.str; default = "http"; }; + basePath = mkOption { type = types.str; default = ""; }; nginx = mkOption { type = types.attrs; default = {}; }; }; }); default = {}; @@ -31,7 +32,8 @@ in { recommendedOptimisation = true; virtualHosts = lib.mapAttrs (_: val: { locations."/" = if val.nginx == {} then { - proxyPass = "${val.protocol}://${val.host}:${toString val.port}"; + proxyPass = + "${val.protocol}://${val.host}:${toString val.port}${val.basePath}"; proxyWebsockets = true; } else val.nginx; }) cfg.routes; -- cgit v1.3.1