mirror of
https://github.com/Gerg-L/nixos.git
synced 2025-12-10 08:53:56 -05:00
25 lines
690 B
Nix
25 lines
690 B
Nix
_: {pkgs, ...}: {
|
|
environment = {
|
|
systemPackages = [pkgs.direnv];
|
|
variables = {
|
|
DIRENV_LOG_FORMAT = "";
|
|
DIRENV_CONFIG = "/etc/direnv";
|
|
};
|
|
#other direnv configuration goes here
|
|
etc."direnv/direnvrc".text = ''
|
|
source ${pkgs.nix-direnv}/share/nix-direnv/direnvrc
|
|
'';
|
|
};
|
|
programs = {
|
|
zsh.interactiveShellInit = ''
|
|
if ! printenv PATH | grep -qc '/nix/store' && [ -z "$IN_NIX_SHELL" ] ; then
|
|
eval "$(direnv hook zsh)"
|
|
fi
|
|
'';
|
|
bash.interactiveShellInit = ''
|
|
if [[ $- == *i* ]] && ! printenv PATH | grep -qc '/nix/store' && [ -z "$IN_NIX_SHELL" ] ; then
|
|
eval "$(direnv hook bash)"
|
|
fi
|
|
'';
|
|
};
|
|
}
|