aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2021-06-09 20:52:52 +0200
committerAdrian Kummerlaender2021-06-09 20:52:52 +0200
commit2c6e88858eda9df3b301ea41c6fc4bd304d80d5c (patch)
tree3316939ee5e27db8d6a6fda78bbaaa3b65f905af
parent66a233a6e234eaabac8ee50f15c86ff2c1700b8d (diff)
downloadnixos_home-2c6e88858eda9df3b301ea41c6fc4bd304d80d5c.tar
nixos_home-2c6e88858eda9df3b301ea41c6fc4bd304d80d5c.tar.gz
nixos_home-2c6e88858eda9df3b301ea41c6fc4bd304d80d5c.tar.bz2
nixos_home-2c6e88858eda9df3b301ea41c6fc4bd304d80d5c.tar.lz
nixos_home-2c6e88858eda9df3b301ea41c6fc4bd304d80d5c.tar.xz
nixos_home-2c6e88858eda9df3b301ea41c6fc4bd304d80d5c.tar.zst
nixos_home-2c6e88858eda9df3b301ea41c6fc4bd304d80d5c.zip
Update niv
-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