aboutsummaryrefslogtreecommitdiff
path: root/modules/network/service-router.service.nix
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-06-13 21:50:54 +0530
committerAkshay Nair <phenax5@gmail.com>2025-06-13 21:50:54 +0530
commite11b9a851851bb47109545093e3accdbcab76859 (patch)
treee733232829ccca32d6ff3cfc88e4794222448676 /modules/network/service-router.service.nix
parent6df186662a37b17015959bf0d6b456ab282b1826 (diff)
downloadhomeserver-nixos-config-e11b9a851851bb47109545093e3accdbcab76859.tar.gz
homeserver-nixos-config-e11b9a851851bb47109545093e3accdbcab76859.zip
Add grafana+prometheus + embed into dashboard
Diffstat (limited to '')
-rw-r--r--modules/network/service-router.service.nix19
1 files changed, 12 insertions, 7 deletions
diff --git a/modules/network/service-router.service.nix b/modules/network/service-router.service.nix
index 3d0b6e7..14fc1b2 100644
--- a/modules/network/service-router.service.nix
+++ b/modules/network/service-router.service.nix
@@ -21,6 +21,7 @@ in {
protocol = mkOption { type = types.str; default = "http"; };
basePath = mkOption { type = types.str; default = ""; };
nginx = mkOption { type = types.attrs; default = {}; };
+ extraOptions = mkOption { type = types.attrs; default = {}; };
}; });
default = {};
};
@@ -30,13 +31,17 @@ in {
services.nginx = {
enable = true;
recommendedOptimisation = true;
- virtualHosts = lib.mapAttrs (_: val: {
- locations."/" = if val.nginx == {} then {
- proxyPass =
- "${val.protocol}://${val.host}:${toString val.port}${val.basePath}";
- proxyWebsockets = true;
- } else val.nginx;
- }) cfg.routes;
+ virtualHosts = lib.mapAttrs (_: val:
+ let
+ opts = if hasAttr "extraOptions" val then val.extraOptions else {};
+ in {
+ locations."/" = if val.nginx == {} then {
+ proxyPass =
+ "${val.protocol}://${val.host}:${toString val.port}${val.basePath}";
+ proxyWebsockets = true;
+ } // opts else val.nginx;
+ }
+ ) cfg.routes;
};
services.nsd = {