From b510cd0e6bec26af56785636c76cdeb525a3bd38 Mon Sep 17 00:00:00 2001 From: Brian Hicks Date: Tue, 25 May 2021 09:15:45 -0500 Subject: [PATCH] update sources.nix --- nix/sources.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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