aboutsummaryrefslogtreecommitdiffstats
path: root/modules/tools/zsh/default.nix
diff options
context:
space:
mode:
authorArpit Chakladar <arpitchakladar@proton.me>2026-03-12 19:48:47 +0530
committerArpit Chakladar <arpitchakladar@proton.me>2026-03-12 19:48:47 +0530
commit532107493512bb56581df1c60166830e44bd5076 (patch)
tree3907b9ba9c58ba1c16703d367fb98c12f22a551b /modules/tools/zsh/default.nix
parent798ed8b954ffa3bad66b23628b381a033a8bb0aa (diff)
downloadhome-manager-config-532107493512bb56581df1c60166830e44bd5076.tar.gz
home-manager-config-532107493512bb56581df1c60166830e44bd5076.zip
Added wrapper functions for devenv shell, nix-shell and nix develop commands that starts the environment in zsh automatically
Diffstat (limited to 'modules/tools/zsh/default.nix')
-rw-r--r--modules/tools/zsh/default.nix11
1 files changed, 9 insertions, 2 deletions
diff --git a/modules/tools/zsh/default.nix b/modules/tools/zsh/default.nix
index 0fed380..fcb7829 100644
--- a/modules/tools/zsh/default.nix
+++ b/modules/tools/zsh/default.nix
@@ -4,12 +4,15 @@
options.tools.zsh = {
enable = lib.mkEnableOption "Enables zsh.";
};
-
- config = lib.mkIf config.tools.zsh.enable {
+
+ config = let
+ nixCommandWrappers = builtins.readFile ./nix-aliases.sh;
+ in lib.mkIf config.tools.zsh.enable {
programs.zsh = {
enable = true;
dotDir = "${config.xdg.configHome}/zsh";
history.path = "${config.xdg.cacheHome}/zsh/history";
+ enableCompletion = true;
initContent = ''
setopt PROMPT_SUBST
@@ -17,9 +20,13 @@
bindkey "^[[3~" delete-char
bindkey "^?" backward-delete-char
+ ${nixCommandWrappers}
'';
};
+ programs.bash.initExtra = lib.mkIf config.programs.bash.enable
+ (lib.mkAfter nixCommandWrappers);
+
home.sessionVariables.SHELL = "${config.programs.zsh.package}/bin/zsh";
};
}