This module integrates direnv into Emacs.
📌 direnv is an environment switcher for the shell. It knows how to hook into bash, zsh, tcsh, fish shell and elvish to load or unload environment variables depending on the current directory. This allows project-specific environment variables without cluttering the ~/.profile file.
Before each prompt, direnv checks for the existence of a “.envrc” file in the current and parent directories. If the file exists (and is authorized), it is loaded into a bash sub-shell and all exported variables are then captured by direnv and then made available to the current shell.
- @hlissner
Become a maintainer?
This module has no flags.
- doom-package:envrc
envrc-mode
has been modified to fail gracefully ifdirenv
isn’t available.envrc-global-mode
has been modified to activate envrc-mode sooner in the major mode activation process, so that any env state performed in mode hooks aren’t overwritten by direnv.- Added direnv support for Org src blocks.
This module does not have a changelog yet.
Enable this module in your doom!
block.
This module requires direnv.
brew install direnv
direnv
is available on the AUR:
yay -S direnv
environment.systemPackages = [ pkgs.direnv ];
Or $ nix-env -i direnv
🔨 This module’s usage documentation is incomplete. Complete it?
To make use of direnv you need a .envrc
file in a directory. Any time you open
a file or buffer in said directory, the doom-package:envrc Emacs package will kick in,
activate the local env, and inject it into Emacs for the current buffer.
🔨 This module has no configuration documentation yet. Write some?
Report an issue?
Consider augmenting direnv with lorri, which will cache nix builds and speed up direnv tremendously:
services.lorri.enable = true;
This module has no FAQs yet. Ask one?
🔨 This module has no appendix yet. Write one?