{ programs.zsh = { enable = true; # `y` opens yazi and, on quit, cd's the shell to wherever yazi ended # up -- yazi itself can't change its parent shell's directory, so it # writes the last dir to --cwd-file for the wrapper to pick up. interactiveShellInit = '' y() { local tmp="$(mktemp)" command yazi --cwd-file="$tmp" "$@" if [ -f "$tmp" ]; then local dir="$(cat "$tmp")" rm -f "$tmp" [ -d "$dir" ] && [ "$dir" != "$PWD" ] && cd "$dir" fi } ''; }; environment.shellAliases = { la = "ls -la"; v = "nvim"; ".." = "cd .."; "..." = "cd ../.."; "s" = "systemctl"; }; }