direnv: Apply nushell env transformations

In nushell, the ENV_CONVERSIONS environment variable is used to
transform the defined variables from a string to a nushell value (PATH
to a list being one of the most common uses). This commit applies
user-defined conversions to direnv-loaded variables.

This fixes binary autocompletion not being triggered for newly added
paths and makes direnv work consistently with nushell
This commit is contained in:
Joaquín Triñanes 2023-12-17 13:45:58 +01:00 committed by Robert Helgesson
parent 8f38f1a231
commit 67c4c05c29
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
2 changed files with 16 additions and 11 deletions

View file

@ -14,6 +14,6 @@
in ''
assertFileExists "${configFile}"
assertFileRegex "${configFile}" \
'let direnv = (/nix/store/.*direnv.*/bin/direnv export json | from json)'
'let direnv = (/nix/store/.*direnv.*/bin/direnv export json \| from json | default {})'
'';
}