about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/interpreters/lua-5/hooks/setup-hook.sh
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2024-03-24 11:04:41 +0100
committerAlyssa Ross <hi@alyssa.is>2024-03-24 11:04:41 +0100
commit5423cabbbf2b6dec5568f1ecabd288d5d9a642ec (patch)
treef316a6a921bfefd3a63bd4502c2eb50ff1644f67 /nixpkgs/pkgs/development/interpreters/lua-5/hooks/setup-hook.sh
parent46a88117a05c3469af5d99433af140c3de8ca088 (diff)
parent8aa81f34981add12aecada6c702ddbbd0375ca36 (diff)
downloadnixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar
nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.gz
nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.bz2
nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.lz
nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.xz
nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.zst
nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.zip
Merge branch 'nixos-unstable-small' of https://github.com/NixOS/nixpkgs
Diffstat (limited to 'nixpkgs/pkgs/development/interpreters/lua-5/hooks/setup-hook.sh')
-rw-r--r--nixpkgs/pkgs/development/interpreters/lua-5/hooks/setup-hook.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/interpreters/lua-5/hooks/setup-hook.sh b/nixpkgs/pkgs/development/interpreters/lua-5/hooks/setup-hook.sh
index 1c445b82afde..7b2d2a4d83d8 100644
--- a/nixpkgs/pkgs/development/interpreters/lua-5/hooks/setup-hook.sh
+++ b/nixpkgs/pkgs/development/interpreters/lua-5/hooks/setup-hook.sh
@@ -22,6 +22,11 @@ addToLuaSearchPathWithCustomDelimiter() {
   # export only if we haven't already got this dir in the search path
   if [[ ${!varName-} == *"$absPattern"* ]]; then return; fi
 
+  # if the path variable has not yet been set, initialize it to ";;"
+  # this is a magic value that will be replaced by the default,
+  # allowing relative modules to be used even when there are system modules.
+  if [[ ! -v "${varName}" ]]; then export "${varName}=;;"; fi
+
   export "${varName}=${!varName:+${!varName};}${absPattern}"
 }