1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-26 21:19:45 +01:00

direnv: work around nushell bug

try/catch in a pipeline does not always work correctly in 0.98,
so avoid the try-catch entirely.

Upstream issue: https://github.com/nushell/nushell/issues/13868
This commit is contained in:
K900 2024-09-26 20:07:37 +03:00 committed by GitHub
parent c124568e10
commit 57e6b30d18
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 8 deletions

View file

@ -141,12 +141,12 @@ in {
| default []
| append {||
let direnv = (
try {
${getExe cfg.package} export json
} catch {
""
}
| from json
# We want to get the stdout from direnv even if it exits with non-zero,
# because it will have the DIRENV_ internal variables defined.
do { ${getExe cfg.package} export json }
| complete
| get stdout
| from json --strict
| default {}
)
if ($direnv | is-empty) {

View file

@ -13,7 +13,6 @@
"home-files/.config/nushell/config.nu";
in ''
assertFileExists "${configFile}"
assertFileRegex "${configFile}" \
'^\s*/nix/store/.*direnv.*/bin/direnv export json$'
assertFileRegex "${configFile}" '/nix/store/.*direnv.*/bin/direnv export json'
'';
}