nominatim-ui: add possibility to customize config.theme.js file

This commit is contained in:
Ivan Mincik
2025-07-07 14:52:00 +02:00
parent cb468f8dc7
commit 30b6164dab
+17 -4
View File
@@ -3,6 +3,12 @@
fetchFromGitHub,
fetchYarnDeps,
mkYarnPackage,
writeText,
# Custom application configuration placed to theme/config.theme.js file
# For the list of available configuration options see
# https://github.com/osm-search/nominatim-ui/blob/master/dist/config.defaults.js
customConfig ? null,
}:
# Notes for the upgrade:
@@ -10,6 +16,16 @@
# * Replace new `package.json` here.
# * Update `version`+`hash` and rebuild.
let
configFile =
if customConfig != null then
writeText "config.theme.js" customConfig
else
writeText "config.theme.js" ''
// Default configuration
Nominatim_Config.Nominatim_API_Endpoint='https://127.0.0.1/';
'';
in
mkYarnPackage rec {
pname = "nominatim-ui";
version = "3.7.1";
@@ -36,11 +52,8 @@ mkYarnPackage rec {
runHook postBuild
'';
# Minimal configuration
# See https://nominatim.org/release-docs/latest/admin/Setup-Nominatim-UI/#installing-nominatim-ui
preInstall = ''
echo "Nominatim_Config.Nominatim_API_Endpoint='https://localhost/';" \
> deps/nominatim-ui/dist/theme/config.theme.js
ln --symbolic ${configFile} deps/nominatim-ui/dist/theme/config.theme.js
'';
installPhase = ''