aboutsummaryrefslogtreecommitdiff
path: root/modules/service-router.service.nix
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-06-13 15:02:58 +0530
committerAkshay Nair <phenax5@gmail.com>2025-06-13 15:02:58 +0530
commitfb3c68a676643e60e396daf4076684e12d157677 (patch)
tree16a6ee14a9d745079e99a066ad30efda1f947e72 /modules/service-router.service.nix
parente6b171f9f1d975ffe34e7a34743b5e92e8593847 (diff)
downloadhomeserver-nixos-config-fb3c68a676643e60e396daf4076684e12d157677.tar.gz
homeserver-nixos-config-fb3c68a676643e60e396daf4076684e12d157677.zip
Syncthing + service router refactor
Diffstat (limited to '')
-rw-r--r--modules/network/service-router.service.nix (renamed from modules/service-router.service.nix)7
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/service-router.service.nix b/modules/network/service-router.service.nix
index 0b9a873..9c4e6e2 100644
--- a/modules/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"; };
+ nginx = mkOption { type = types.attrs; default = {}; };
}; });
default = {};
};
@@ -27,10 +28,12 @@ in {
config = lib.mkIf cfg.enable {
services.nginx = {
enable = true;
+ recommendedOptimisation = true;
virtualHosts = lib.mapAttrs (_: val: {
- locations."/" = {
+ locations."/" = if val.nginx == {} then {
proxyPass = "${val.protocol}://${val.host}:${toString val.port}";
- };
+ proxyWebsockets = true;
+ } else val.nginx;
}) cfg.routes;
};