From 2319821137279b8616a05a1c704292ae989f40fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A9clairevoyant?= <848000+eclairevoyant@users.noreply.github.com> Date: Tue, 5 Mar 2024 00:23:04 -0500 Subject: [PATCH] nixos/scrutiny: default collector api endpoint port to point at web app port --- nixos/modules/services/monitoring/scrutiny.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/monitoring/scrutiny.nix b/nixos/modules/services/monitoring/scrutiny.nix index 7de15150d668..aef924ef840c 100644 --- a/nixos/modules/services/monitoring/scrutiny.nix +++ b/nixos/modules/services/monitoring/scrutiny.nix @@ -3,7 +3,7 @@ let inherit (lib) maintainers; inherit (lib.meta) getExe; inherit (lib.modules) mkIf; - inherit (lib.options) mkEnableOption mkOption mkPackageOption; + inherit (lib.options) literalExpression mkEnableOption mkOption mkPackageOption; inherit (lib.types) bool enum nullOr port str submodule; cfg = config.services.scrutiny; @@ -140,7 +140,8 @@ in options.api.endpoint = mkOption { type = str; - default = "http://localhost:8080"; + default = "http://localhost:${toString cfg.settings.web.listen.port}"; + defaultText = literalExpression ''"http://localhost:''${config.services.scrutiny.settings.web.listen.port}"''; description = "Scrutiny app API endpoint for sending metrics to."; };