Revert "devShellTools.unstructuredDerivationInputEnv: Match passAsFile basename"

This reverts commit 1cf3103bca.

The commit implemented a "nice to have" TODO, which ultimately causes
hash differences between Lix and Nix. We can't conditionally use the
`convertHash` builtin, because we don't have an alternative to produce
the same results.
This commit is contained in:
Wolfgang Walther 2025-10-14 13:34:37 +02:00
parent 939affa933
commit af6b831faf
No known key found for this signature in database
GPG key ID: B39893FA5F65CAE1
2 changed files with 2 additions and 23 deletions

View file

@ -1,6 +1,6 @@
{
lib,
writeTextFile,
writeText,
}:
let
inherit (builtins) typeOf;
@ -36,24 +36,7 @@ rec {
str = valueToString value;
in
if lib.elem name (drvAttrs.passAsFile or [ ]) then
let
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" "${
writeTextFile {
name = "shell-passAsFile-${name}";
text = str;
destination = "/${basename}";
}
}/${basename}"
lib.nameValuePair "${name}Path" "${writeText "shell-passAsFile-${name}" str}"
else
lib.nameValuePair name str
)

View file

@ -170,10 +170,6 @@ lib.recurseIntoAttrs {
set -x
diff $exampleBarPathString $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."}