nixos-config/nixos/components/terminal/direnv.nix
Ingolf Wagner 9440397500
udpate
2023-07-22 01:16:50 +02:00

26 lines
657 B
Nix

{ pkgs, config, lib, ... }:
with lib;
{
options.components.terminal.direnv.enable = mkOption {
type = lib.types.bool;
default = config.components.terminal.enable;
};
config = mkIf (config.components.terminal.direnv.enable) {
environment.systemPackages = [ pkgs.direnv ];
home-manager.sharedModules = [
{
programs.direnv.enable = true;
programs.git.ignores = [ ".envrc" ".direnv" ];
}
];
programs.zsh.interactiveShellInit = ''
eval "$(${pkgs.direnv}/bin/direnv hook zsh)"
'';
programs.bash.interactiveShellInit = ''
eval "$(${pkgs.direnv}/bin/direnv hook bash)"
'';
};
}