Jörg Thalheim
e7bf22e0b6
speedup nix_direnv_watch_file
...
Turns out that calling `direnv watch` actually costs a few ms, which can
accumulate for large amount of files.
2022-08-27 12:33:42 +02:00
Bryan Bennett
ba0cbc1c07
Watch nixfile in use_nix
...
This allows us to track the entry point the user specified
or whatever entry point we fallback to via auto-selection.
This should suprise fewer users.
Closes #197
2022-08-22 14:37:46 -04:00
Andrew Marshall
2011d81f03
Fix error with strict_env
...
With direnv’s `strict_env`, previously got an error
> NIX_BUILD_TOP: unbound variable
I tried to adjust the tests to catch this, but unfortunately I could not
get it to fail.
2022-07-22 12:05:42 -04:00
Justin Bailey
f3587d4c26
Ensure extra arguments passed to shell
...
Extra arguments passed to `use nix` (such as `--arg` or `--argstr`)
were getting clobbered by an errant re-definition. Removed that
definition so those arguments get passed along.
2022-06-01 08:51:57 +02:00
Bryan Bennett
a4d24b9052
Recursively remove NIX_BUILD_TOP
...
Fixes #187
2022-05-24 08:24:59 -04:00
Bryan Bennett
bca290c875
Reimplement default watches with nix_direnv_watch_file
2022-05-24 08:24:53 -04:00
Bryan Bennett
8a731ae0ab
bump version 2.1.0
2022-05-01 09:48:47 -04:00
Bryan Bennett
2b9b1de447
Clarify README; Add documentation of supported options to use-nix
2022-05-01 09:32:28 -04:00
Bryan Bennett
891111e64d
use_nix: introduce initial generic nix argument parsing
2022-04-29 08:50:13 -04:00
Jonas Collberg
d5a5df7eab
Add missing parameter to import expression
2022-04-27 10:20:39 +02:00
Bryan Bennett
04d1361c19
bump version 2.0.1
2022-04-25 09:28:56 -04:00
Bryan Bennett
e2341c4f2d
GH-168: Fix custom attributes in use_nix
2022-04-25 08:43:25 -04:00
Bryan Bennett
f464d90b80
Fix path and package handling in use_nix arg parsing
...
Fixes #162
2022-04-19 14:54:28 -04:00
Bryan Bennett
804418f97f
Fix nix_direnv_version to properly handle major version bumps
...
Closes #159
2022-04-14 08:40:37 -04:00
Jörg Thalheim
d677f78787
bump version 2.0.0
2022-04-07 09:02:29 +02:00
Eric Wolf
d0c7bc5d90
nix channel path might be a link to a store path
...
Use `_nix_direnv_realpath` to resolve it, that way
the store path gets noticed and "borrow some bits from ..."
succeeds.
2022-04-03 20:45:31 -04:00
Eric Wolf
8ce0765b55
use_nix: file was used in two places and values got confused
...
Using `file` in the for loop over the `nix_watches` entries
left a value in `file`, so the check '[[ "$file" == ""]]'
always failed.
Found by adding `set -x` to `direnvrc` temporarily and staring
hard at the output.
2022-04-03 20:45:27 -04:00
Bryan Bennett
3cca1afdec
Start work of integrating nix 24 features
2022-04-03 20:45:19 -04:00
Bryan Bennett
deb345be82
Move realpath into a function
...
Using ls to resolve the path does not work if the next level is also a symlink
2022-04-03 20:45:15 -04:00
Bryan Bennett
7133709885
create a function for all pre-flight checks
2022-04-03 20:45:11 -04:00
Bryan Bennett
fef7340826
Use ls to resolve symlink
2022-04-03 20:45:07 -04:00
Bryan Bennett
c1df7c3c15
Don't track flake.{nix,lock} for remote flakes
2022-04-03 20:45:02 -04:00
Petar Kirov
d7ddae4be8
Release version 1.6.1
...
* Update hashes
* Hash obtained via:
```sh
direnv fetchurl 'https://raw.githubusercontent.com/nix-community/nix-direnv/master/direnvrc ' \
| grep -m1 -o 'sha256-.*'
```
* Bump tag to 1.6.1 in:
* README.md
* direnvrc
* template/.envrc
This release includes the following changes:
* Allow watching of arbitrary files for nix flake updates ([#148 ][1])
[1]: https://github.com/nix-community/nix-direnv/pull/148
2022-03-22 11:56:16 +02:00
polygon
1241f1115e
Add nix_direnv_watch_file command
...
Used to watch files that, when changed, trigger an update of the
cached nix environment.
2022-02-25 21:09:10 +01:00
Jörg Thalheim
1257fd47e4
bump version 1.6.0
2022-02-07 21:20:54 +01:00
Bryan Bennett
c6db289e0f
Print a more useful error on old direnv versions
2022-02-02 14:23:59 -05:00
Bryan Bennett
effc976ce7
Use non-zero exit code for error status
2022-01-31 13:26:21 -05:00
Bryan Bennett
6d6f0d85a3
Declare (and enforce) a minimum direnv version
...
2.21.3 introduces extglob to direnv's stdlib.
This means we need at least 2.21.3 to execute nix_direnv_version.
This just enforces a previously unstated dependency.
2022-01-31 13:24:02 -05:00
Bryan Bennett
2a99301bbc
Quote argument expansion
...
Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
2021-12-22 07:59:20 -05:00
Bryan Bennett
0eef85db95
Allow passing arguments to print-dev-env invocation
2021-12-21 10:05:44 -05:00
John Axel Eriksson
7b801eaaec
invalidate cache on changes to devshell.toml
2021-12-17 11:16:29 +01:00
Jörg Thalheim
57235bb89e
bump version 1.5.1
2021-12-16 10:07:14 +01:00
Jörg Thalheim
76f26b2692
useFlake(): fix sed invocation on legacy operating systems
...
macOS has `-i` but it insists on writing backup files.
2021-11-13 06:45:46 +01:00
Jörg Thalheim
083ac16bf5
bump version 1.5.0
2021-10-21 07:50:57 +02:00
Jörg Thalheim
8729f1740c
Merge pull request #106 from immae/add_argsum
...
Add a suffix to cache file to allow multiple calls to use_nix
2021-09-12 05:32:00 +01:00
Jörg Thalheim
77418af186
make shellcheck happy
2021-09-12 06:29:45 +02:00
Jörg Thalheim
ceb91896cd
prefer sha1sum over shasum
...
sha1sum is written in C, while shasum requires perl interpreter
and has higher overhead.
2021-09-12 06:25:14 +02:00
Jörg Thalheim
97d73b892a
remove dependency on external tools when computing cache key
2021-09-12 06:23:42 +02:00
Zak B. Elep
37c36013b4
direnvrc: don't override TMPDIR
...
On macOS, `$TMPDIR` is usually a private temp dir separate from
`/tmp` - this trips up some programs like `emacsclient` when under
nix-shell.
2021-08-15 20:05:09 +08:00
Ismaël Bouya
9544919b4c
Add a suffix to allow multiple calls to use_nix
...
This change permits to make multiple calls to use_nix, with different
arguments passed to it. It will generate a cache file for each distinct
"argument list" rather than based solely on the nixpkgs version.
2021-08-12 12:08:18 +02:00
ryneeverett
6e68ea7235
flakes: Don't run shellHook on cached dev shells
...
This makes the behavior of `use flake` consistent with that of `use
nix`.
Resolve #90 .
2021-06-08 20:51:07 -04:00
Jörg Thalheim
f2fd3f433c
bump version 1.4.0
2021-06-03 18:44:32 +02:00
Dominique Martinet
fd12ba39f3
use flake: allow optional flake expression
...
This allows using flake.nix out of tree, which is very appreciable
if you develop in a big repository as flake evaluation will copy the
whole git archive to store everytime it changes.
2021-05-26 13:49:31 +09:00
Jörg Thalheim
a14fc56bdf
bump version 1.3.0
2021-05-19 07:13:59 +02:00
bb010g
9f40e3b1c3
direnvrc: Add nix_direnv_version
...
In the style of direnv's `direnv_version`.
729fbecd96/stdlib.go (L1173-L1179)
Can be tested for with `has`, e.g. to decide on using `source_url`.
2021-05-19 06:47:20 +02:00
Jörg Thalheim
be4863dae6
Revert "async nix-shell"
...
This reverts commit 5996ecbfdb .
2021-05-14 08:42:04 +02:00
Jörg Thalheim
5996ecbfdb
async nix-shell
2021-05-09 08:38:49 +02:00
Bruno Bigras
760ce16e6c
don't override experimental-features
...
Co-authored-by: regnat <rg@regnat.ovh>
2021-05-05 12:09:09 -04:00
Jörg Thalheim
c3a8747d62
direnvc: add TODO
2021-03-19 21:20:50 +00:00
meck
b2d35ce3e9
save XDG_DATA_DIRS in flakes
2021-03-19 13:02:49 +01:00