y() now lives in hosts/globalServices/zsh.nix via programs.zsh.interactiveShellInit, so it works on every host (previously only tnix had it, via home-manager, and pinix's plain package had no cd-on-quit wrapper at all). yazi package moved from pinix-local to global packages.nix for the same reason. Dropped from home/tnix/localModules/zsh.nix as now-redundant: the local yazi() function (same wrapper, bound to the wrong name and shadowed by the global one anyway), the `y = "yazi"` alias (would have shadowed the new global function), and a dead HYPRLAND_INSTANCE_SIGNATURE export left over from the sway migration -- nothing in the repo references it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
29 lines
700 B
Nix
29 lines
700 B
Nix
{
|
|
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";
|
|
};
|
|
}
|