devShellTools.unstructuredDerivationInputEnv: Support older Nix
This commit is contained in:
@@ -31,10 +31,14 @@ rec {
|
||||
in if lib.elem name (drvAttrs.passAsFile or [])
|
||||
then
|
||||
let
|
||||
nameHash = builtins.convertHash {
|
||||
hash = "sha256:" + builtins.hashString "sha256" name;
|
||||
toHashFormat = "nix32";
|
||||
};
|
||||
nameHash =
|
||||
if builtins?convertHash
|
||||
then builtins.convertHash {
|
||||
hash = "sha256:" + builtins.hashString "sha256" name;
|
||||
toHashFormat = "nix32";
|
||||
}
|
||||
else
|
||||
builtins.hashString "sha256" name;
|
||||
basename = ".attr-${nameHash}";
|
||||
in
|
||||
lib.nameValuePair "${name}Path" "${
|
||||
|
||||
@@ -149,7 +149,9 @@ lib.recurseIntoAttrs {
|
||||
|
||||
diff $exampleBarPathString $barPath
|
||||
|
||||
[[ "$(basename $exampleBarPathString)" = "$(basename $barPath)" ]]
|
||||
${lib.optionalString (builtins?convertHash) ''
|
||||
[[ "$(basename $exampleBarPathString)" = "$(basename $barPath)" ]]
|
||||
''}
|
||||
)
|
||||
|
||||
''${args:+fail "args should not be set by Nix. We don't expect it to and unstructuredDerivationInputEnv removes it."}
|
||||
|
||||
Reference in New Issue
Block a user