-
-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Requires GNU grep #3
Comments
Interesting. I might be able to replace this invocation with an awk call that should be portable. Do you now if |
@zimbatm does direnv on macOS uses the builtin bash btw? Because that might also cause problems. |
Replacing |
yes... direnv uses whatever bash is in the environment |
In that case I should suggest people to install |
The one that comes from nixpkgs is bound to the nixpkgs bash at compile time. |
Anyone using Homebrew should also |
It would be great if |
Can we convince the homebrew maintainers to also hard code bash? https://github.com/Homebrew/homebrew-core/blob/master/Formula/direnv.rb#L18 |
@Mic92 direnv looks in |
Ok. This would not play well with vanilla nix or most other system package manager in that regard, but a home-manager module could work. |
We need to make sure that nix-direnv is explicitly using utils from nixpkgs, since the operating system versions of the utils may not play nicely (e.g. BSD-grep on macOS won't work w/ nix-direnv). See also: nix-community/nix-direnv#3
We need to make sure that nix-direnv is explicitly using utils from nixpkgs, since the operating system versions of the utils may not play nicely (e.g. BSD-grep on macOS won't work w/ nix-direnv). See also: nix-community/nix-direnv#3
Nix-direnv can now be installed via |
Issue
This isn't really an issue with nix-direnv, but more of a caveate I encountered when trying to use nix-direnv on macOS. I first encountered this using direnv-mode in emacs w/ nix-direnv on macOS, but it looks like it's also a problem just using direnv from bash on macOS.
From a directory that DOESN'T have a cached environment (i.e.
.direnv
either doesn't exist or is empty), the following error is shown when making a first attempt at loading the env:which results in the creation of an empty cache.
Setup
Directory structure:
.direnv
:shell.nix
:Steps to reproduce
Fix
The issue seems to be that nix-direnv is trying to invoke the macOS builtin BSD-grep at
/usr/bin/grep
, which for one reason or another doesn't like (indirenvrc
):I haven't actually spent any time trying to figure out WHY that line is problematic with the builtin grep, but I managed to sort this out by installing nix-direnv with the following derivation, which explicitely uses nixpkgs.gnugrep
The text was updated successfully, but these errors were encountered: