Skip to content
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

Better integration into package manager when loading third-party plugins #5

Closed
zimbatm opened this issue Mar 11, 2020 · 5 comments
Closed

Comments

@zimbatm
Copy link
Member

zimbatm commented Mar 11, 2020

It would be great if direnv would have something like a .direnv.d or even environment variables to load third party plugins. I think it is time to package nix-direnv in nixpkgs itself.

Originally posted by @Mic92 in #3 (comment)

@zimbatm
Copy link
Member Author

zimbatm commented Mar 11, 2020

@Mic92 direnv looks in ~/.config/direnv/lib/*.sh for additional libs. (since v2.21)

Like you said it doesn't play nicely with package managers but I am open to suggestions. I don't know how bad it would be to load arbitrary code from the system yet.

@zimbatm
Copy link
Member Author

zimbatm commented Mar 11, 2020

Another experiment I have is a new source_url stdlib function over here: direnv/direnv#562
That might be better as it puts the .envrc write in control of the version that is being loaded.

@Mic92 Mic92 changed the title It would be great if direnv would have something like a .direnv.d or even environment variables to load third party plugins. I think it is time to package nix-direnv in nixpkgs itself. Better integration into package manager when loading third-party plugins Mar 11, 2020
@Mic92
Copy link
Member

Mic92 commented Mar 11, 2020

For nix we would need a search path for full integration to load plugins from all possible user and system profiles.

something like: DIRENV_PLUGIN_PATH=$HOME/.nix-profile/lib/direnv/:/run/current-system/sw/lib/direnv:/nix/var/nix/profiles/default/lib/direnv

If not set direnv could fallback to a compiled-in PREFIX, i.e

DIRENV_PLUGIN_PATH=/usr/local/lib/direnv/

if PREFIX == /usr/local/

For other package manager is is usually fine to only lookup in PREFIX.

@Mic92 Mic92 mentioned this issue May 9, 2020
@Mic92
Copy link
Member

Mic92 commented May 11, 2020

Now nix-direnv is loaded from the nix-profile: https://github.com/nix-community/nix-direnv#home-manager

@Mic92
Copy link
Member

Mic92 commented Jul 19, 2020

I think I am fine with the status quo of using home-manager to load this.

@Mic92 Mic92 closed this as completed Jul 19, 2020
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

No branches or pull requests

2 participants