summaryrefslogtreecommitdiff
path: root/nix/sources.nix
diff options
context:
space:
mode:
authorstuebinm2021-06-23 21:38:58 +0200
committerstuebinm2021-06-23 21:38:58 +0200
commit017d861c92ba4c5e889568842f3b6258d6ed96dc (patch)
tree2031a9e94a71ce294e00d74ff6d5fe9e8272cb04 /nix/sources.nix
parent1b59a5b367cfae616a7ecd814795de89432dc36b (diff)
update sources
Diffstat (limited to '')
-rw-r--r--nix/sources.nix5
1 files changed, 4 insertions, 1 deletions
diff --git a/nix/sources.nix b/nix/sources.nix
index b796fff..1938409 100644
--- a/nix/sources.nix
+++ b/nix/sources.nix
@@ -98,7 +98,10 @@ let
saneName = stringAsChars (c: if isNull (builtins.match "[a-zA-Z0-9]" c) then "_" else c) name;
ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}";
in
- if ersatz == "" then drv else ersatz;
+ if ersatz == "" then drv else
+ # this turns the string into an actual Nix path (for both absolute and
+ # relative paths)
+ if builtins.substring 0 1 ersatz == "/" then /. + ersatz else /. + builtins.getEnv "PWD" + "/${ersatz}";
# Ports of functions for older nix versions