nixos/scrutiny: default collector api endpoint port to point at web app port

This commit is contained in:
éclairevoyant 2024-03-05 00:23:04 -05:00
parent fc5116d75c
commit 2319821137
No known key found for this signature in database
GPG key ID: E3813AEAA02DB54B

View file

@ -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.";
};