diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-06-13 16:27:15 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-06-13 16:27:15 +0530 |
| commit | 60e26854dac063f0732f44babb3c7d3dbf7888a0 (patch) | |
| tree | ba19e14d142a06e7cec3abdb377a986214e290c4 /modules/network | |
| parent | be1266cb5fd7a5a65a47a2238ba23447b6062c2d (diff) | |
| download | homeserver-nixos-config-60e26854dac063f0732f44babb3c7d3dbf7888a0.tar.gz homeserver-nixos-config-60e26854dac063f0732f44babb3c7d3dbf7888a0.zip | |
Add git + gitweb integration
Diffstat (limited to 'modules/network')
| -rw-r--r-- | modules/network/default.nix | 1 | ||||
| -rw-r--r-- | modules/network/service-router.service.nix | 4 |
2 files changed, 4 insertions, 1 deletions
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; |
