Migrate bash shell aliases to global home configuration, additionally override cd command to implement neovim terminal pwd integration

This commit is contained in:
Curt Spark 2024-08-04 21:46:50 +01:00
parent cd572d460b
commit 287d45e79c
3 changed files with 15 additions and 6 deletions

View File

@ -89,9 +89,6 @@
};
programs.bash.shellAliases = {
sudo = "sudo ";
doas = "doas ";
edit = "$EDITOR";
nixos-rebuild-system-flake = "sudo nixos-rebuild switch --flake /etc/nixos#desktop";
};

View File

@ -47,9 +47,6 @@
};
programs.bash.shellAliases = {
sudo = "sudo ";
doas = "doas ";
edit = "$EDITOR";
nixos-rebuild-system-flake = "sudo nixos-rebuild switch --flake /etc/nixos#laptop";
};

View File

@ -50,6 +50,15 @@ in
USBKEYBUSID="$(echo `grep 0930 /sys/bus/usb/devices/*/idVendor | cut -d '/' -f 6`)"
sudo usbip unbind -b $USBKEYBUSID
'')
# Scripts to replace user utils with ones that can interface with the neovim inbuilt terminal
(pkgs.writeShellScriptBin "cd-nvim" ''
if [ $1 ]; then
builtin cd "''$(realpath "$1")" && printf "\033]7;file://''${PWD}\033\\"
else
builtin cd "''${HOME}" && printf "\033]7;file://''${PWD}\033\\"
fi
'')
# wineWowPackages.full
# native wayland support (unstable)
@ -287,6 +296,12 @@ in
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
([[ -z $(tty) ]] && nvim +terminal) || fastfetch
'';
shellAliases = {
sudo = "sudo ";
doas = "doas ";
edit = "$EDITOR";
cd = "source cd-nvim";
};
};
programs.git = {