diff --git a/modules/home/zsh.nix b/modules/home/zsh.nix index 8082e59..53e7fbb 100644 --- a/modules/home/zsh.nix +++ b/modules/home/zsh.nix @@ -110,6 +110,20 @@ printf "%s\n" "''${url}" } + function nixcd () { sakura + PACKAGE_NAME="$1" + if [[ "$PACKAGE_NAME" = "" ]]; then + echo "Usage: nixcd " + fi + PKGINSTORE="$(NIXPKGS_ALLOW_UNFREE=1 nix path-info nixpkgs#$PACKAGE_NAME --impure)" + if [[ -d "$PKGINSTORE" ]]; then + cd $PKGINSTORE + else + echo "Could not find path for package: $PKGINSTORE" + return 1 + fi + } + export export PATH="''${PATH}:''${HOME}/.local/bin/:''${HOME}/.cargo/bin/:''${HOME}/.fzf/bin/" # if [[ $(which sxiv&>/dev/null && echo 1) == "1" ]]; then