nixos-config/components/terminal/direnv.nix

35 lines
693 B
Nix
Raw Normal View History

2024-08-29 03:26:04 +02:00
{
pkgs,
config,
lib,
...
}:
2023-05-28 20:22:23 +02:00
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 ];
2023-07-22 01:16:50 +02:00
home-manager.sharedModules = [
{
programs.direnv.enable = true;
2024-08-29 03:26:04 +02:00
programs.git.ignores = [
".envrc"
".direnv"
];
2023-07-22 01:16:50 +02:00
}
];
2023-05-28 20:22:23 +02:00
programs.zsh.interactiveShellInit = ''
eval "$(${pkgs.direnv}/bin/direnv hook zsh)"
'';
programs.bash.interactiveShellInit = ''
eval "$(${pkgs.direnv}/bin/direnv hook bash)"
'';
};
}