about summary refs log tree commit diff stats
path: root/nix
diff options
context:
space:
mode:
authorAlan Pearce2024-05-22 13:21:15 +0200
committerAlan Pearce2024-05-22 13:21:15 +0200
commit027db4372e82e445c531c958c2da0f9cf6ae1e03 (patch)
tree20176def9b78203a785cd6d768a52e2231999400 /nix
parent4b4ef1464c241c398e4e469d862f0848f75d5894 (diff)
downloadsearchix-027db4372e82e445c531c958c2da0f9cf6ae1e03.tar.lz
searchix-027db4372e82e445c531c958c2da0f9cf6ae1e03.tar.zst
searchix-027db4372e82e445c531c958c2da0f9cf6ae1e03.zip
fix(nix): generate default baseURL from listen address and port
Diffstat (limited to 'nix')
-rw-r--r--nix/modules/default.nix14
1 files 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;