From 027db4372e82e445c531c958c2da0f9cf6ae1e03 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 22 May 2024 13:21:15 +0200 Subject: fix(nix): generate default baseURL from listen address and port --- nix/modules/default.nix | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/nix/modules/default.nix b/nix/modules/default.nix index 8c8499a..509a372 100644 --- a/nix/modules/default.nix +++ b/nix/modules/default.nix @@ -106,11 +106,15 @@ in default = "localhost"; }; - baseURL = mkOption { - type = types.str; - description = "The base URL that searchix will be served on."; - default = "http://localhost:3000"; - }; + baseURL = + let + inherit (config.services.searchix.settings) web; + in + mkOption { + type = types.str; + description = "The base URL that searchix will be served on."; + default = "http://${web.listenAddress}:${web.port}"; + }; environment = mkOption { type = types.str; -- cgit 1.4.1