Commit graph

187 commits

Author SHA1 Message Date
Jörg Thalheim
fed21f2dea bump version 3.0.6 2024-09-03 20:51:05 +02:00
Joaquín Triñanes
f88088b17b
Respect existing _nix_direnv_manual_reload 2024-08-28 19:23:35 +02:00
mergify[bot]
5bbcef53fa
Merge branch 'master' into ambient-nix-with-fallback 2024-08-21 19:16:33 +00:00
K900
94def84445 Use ambient Nix when available, with a two stage fallback
First, we try to use the ambient Nix version.
Then, we try to use $NIX_DIRENV_FALLBACK_NIX, which is set by default,
but can also be overridden by the user.
Only then, if neither is available, we fail.

Fixes #451.
2024-08-21 21:55:49 +03:00
Joaquín Triñanes
aff76f86fe
Fix unbound shell variable errors on strict mode 2024-08-20 14:34:44 +02:00
Jörg Thalheim
05db15c3e8 bump version 3.0.5 2024-06-03 14:07:42 +02:00
Bryan Bennett
54add2fba2
Set sh-mode explicitly for emacs users 2024-05-31 16:10:30 -04:00
Bryan Bennett
992b88b87d
Set IN_NIX_SHELL explicitly in use_nix 2024-05-31 16:10:30 -04:00
Bryan Bennett
ba0cf20e0f
Update tests to expect new output strings 2024-04-22 08:40:43 -04:00
Bryan Bennett
aa50e0f781
Set NIX_DIRENV_DID_FALLBACK where appropriate 2024-04-19 15:58:10 -04:00
Bryan Bennett
e9d3a36775
Issue a warning if we fallback to the old shell 2024-04-19 15:54:37 -04:00
Ivan Trubach
67cdb087fb Fix local flakes when prefixed with "path:" (again)
This change fixes regression introduced in commit
4bf5d40290. In particular, we should not
be passing flake URI without schema to the nix flake archive command.
2024-04-01 07:48:22 +02:00
Bryan Bennett
875a7a9a52
Restore terminfo from calling shell 2024-01-05 09:34:07 -05:00
Jörg Thalheim
fc25d1ea4a bump version 3.0.4 2024-01-02 22:46:30 +01:00
Jörg Thalheim
b634b13afd fix nix_direnv_version terminating direnv
This function is used in our README for a long time to upgrade nix-direnv.
Now it's failing execution instead.
2024-01-02 22:11:44 +01:00
Jörg Thalheim
cb88841c32 bump version 3.0.3 2023-12-21 11:14:14 +01:00
Jörg Thalheim
ced8704eff make version sort compatible with busybox sort
There are too many cases where people have non-coreutils versions in there PATH.
2023-12-21 10:22:42 +01:00
Jörg Thalheim
324ab0e942 bump version 3.0.2 2023-12-20 08:29:58 +01:00
Jörg Thalheim
04d6770ea7 set bash 4.4 as minimum 2023-12-20 08:20:11 +01:00
Arthur Noel
e079c6baa2 make version check skip less fragile 2023-12-19 19:54:28 +00:00
Arthur Noel
9d4a2cf0a6 consistently use $direnv builtin 2023-12-19 19:43:10 +00:00
Jörg Thalheim
dad4923849 bump version 3.0.1 2023-12-18 13:58:44 +01:00
Jörg Thalheim
1d3d8b61e7 don't rely on direnv to be in $PATH
fixes https://github.com/nix-community/nix-direnv/issues/446
2023-12-18 13:46:11 +01:00
Arthur Noel
add18037af make self-contained using resholve 2023-12-15 13:55:57 +00:00
Arthur Noel
4d326252ae treefmt: use shfmt and statix
simplifies treefmt.nix and adds `direnvrc` to treefmt includes for
shellcheck
2023-12-14 20:23:43 +00:00
Jörg Thalheim
4e0d1e6cf9 bump version 3.0.0 2023-12-10 22:00:37 +01:00
Jörg Thalheim
6b44093d74 deprecate nix_direnv_watch_file 2023-12-09 13:43:43 +01:00
Arthur Noel
30e02c2a10 version check: clearer language 2023-12-03 10:05:23 +00:00
Arthur Noel
31984f6083 set minimum bash version 5.2 2023-12-03 08:48:12 +00:00
Arthur Noel
04b2367f01 simplify required version checks using sort --version-sort 2023-12-03 08:47:20 +00:00
Bryan Bennett
c22289449d
Rename tmp_profile to avoid cleanup as a gcroot 2023-11-29 15:47:13 -05:00
Bryan Bennett
0c03af5544
Delay invalidating cache and gcroots until print-dev-env call succeeds
We currently eagerly invalidate the gcroots and old profile rc,
assuming that the devshell is in a usable state.
If this assumption does not hold,
we can invalidate a working state for a broken one.

Here we just delay calling _nix_clean_old_gcroots
until we know that we're in a usable state.

In the case that the flake is in an unusable state,
this simply reuses the newest working state.

This should address #412.
2023-11-29 13:58:27 -05:00
Arthur Noel
e450871ff3 idiomatic test usage 2023-11-29 13:30:44 +00:00
Arthur Noel
653f9e7217 drop _nix_direnv_realpath
its not necessary - nix-store dereferences, and its use with the path
returned by nix-instantiate does nothing
2023-11-29 13:30:44 +00:00
Arthur Noel
7f41803e52 define nix flakes command as function and consistently use it
also tidy NIX_BIN_PREFIX usage
2023-11-29 13:30:44 +00:00
Arthur Noel
d1e5ab0e02 _nix_add_gcroot: remove redundant symlink 2023-11-29 13:30:44 +00:00
Arthur Noel
57d2738ded remove doubled watches 2023-11-29 13:30:44 +00:00
Arthur Noel
a6b4125c93 bad flake expr is fatal 2023-11-29 13:30:44 +00:00
Arthur Noel
26d7044cd7 refactor logging
use functions wrapping direnv log_status and log_error
2023-11-29 13:28:03 +00:00
Jörg Thalheim
511f6554b3 bump version 2.5.1 2023-11-27 21:22:13 +01:00
Jörg Thalheim
a59d64917e do not deprecate nix_direnv_watch_file yet
we do this in 3.0.0
2023-11-27 20:19:21 +01:00
Arthur Noel
647d7feb7f _nix_direnv_watches: update path regex to match capitalized path 2023-11-26 21:06:37 +00:00
Jörg Thalheim
c84183c0ac bump version 2.5.0 2023-11-26 14:34:24 +01:00
mergify[bot]
c33cad83f8
Merge branch 'master' into no-grep 2023-11-26 13:29:01 +00:00
Jörg Thalheim
946b84daed fix crash if DIRENV_WATCHES is not set
This shouldn't happen in our current usage but better safe than sorry.
2023-11-26 14:19:24 +01:00
Jörg Thalheim
a20b32d9cd drop dependency on jq 2023-11-26 14:03:35 +01:00
Jörg Thalheim
4248f7735b use direnv show_dump to extract direnv watches 2023-11-26 13:15:37 +01:00
Jörg Thalheim
bcba9830e4 drop dependency on gnugrep 2023-11-26 12:32:12 +01:00
Arthur Noel
433948e9ad fix typos 2023-11-25 22:27:58 +00:00
Arthur Noel
6997988d1b drop nix_direnv_watch_file - instead parse DIRENV_WATCHES
fixes #408
2023-11-25 22:27:58 +00:00