diff --git a/modules/common/shell.nix b/modules/common/shell.nix index cab4d78..1924fde 100644 --- a/modules/common/shell.nix +++ b/modules/common/shell.nix @@ -1,25 +1,42 @@ { pkgs, lib, config, ... }: { - config.users.defaultUserShell = pkgs.zsh; + config = { + users.defaultUserShell = pkgs.zsh; - config.programs.thefuck.enable = true; - config.programs.zsh = { - enable = true; - histSize = 1000000; - histFile = "$HOME/.zsh_history"; - - setOptions = [ - "INC_APPEND_HISTORY" - "SHARE_HISTORY" + environment.systemPackages = with pkgs; [ direnv ]; + nix.settings = { + keep-outputs = true; + keep-derivations = true; + }; + custom.impermanence.userExtraDirs.jake = [ + ".local/share/direnv" ]; - syntaxHighlighting = { - enable = true; - }; + programs.thefuck.enable = true; - shellAliases = { - "nixos-rebuild" = "nixos-rebuild --flake \"/etc/nixos#${config.networking.fqdn}\""; + programs.zsh = { + enable = true; + histSize = 1000000; + histFile = "$HOME/.zsh_history"; + + setOptions = [ + "INC_APPEND_HISTORY" + "SHARE_HISTORY" + ]; + + syntaxHighlighting = { + enable = true; + }; + + shellAliases = { + "nixos-rebuild" = "nixos-rebuild --flake \"/etc/nixos#${config.networking.fqdn}\""; + }; + + interactiveShellInit = with pkgs; '' + eval "$(${direnv}/bin/direnv hook zsh)" + source ${nix-direnv}/share/nix-direnv/direnvrc + ''; }; }; }