Skip to content

fix .envrc failing when using direnv and not nix#142

Open
slim wants to merge 1 commit intojoeycastillo:mainfrom
slim:fix/envrc
Open

fix .envrc failing when using direnv and not nix#142
slim wants to merge 1 commit intojoeycastillo:mainfrom
slim:fix/envrc

Conversation

@slim
Copy link
Contributor

@slim slim commented Nov 12, 2025

If you are using direnv but you are not using the nix falvour of linux, you get an error message as soon as you enter the project directory.

@@ -1,5 +1,7 @@
# shellcheck shell=bash
if [ -f /etc/NIXOS ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this file present when using nix outside of nixos?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably. The following commands are nix specifc anyway and there should some kind of test before them. But maybe a better solution would be to remove .envrc from versioning ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that I usually setup the .envrc file myself (one liner in most cases).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants