mirror of
https://github.com/Ahwxorg/nixos-config.git
synced 2025-12-04 15:00:13 +01:00
feat: adds nixcd function
This commit is contained in:
parent
570f3d511a
commit
664a158281
1 changed files with 14 additions and 0 deletions
|
|
@ -110,6 +110,20 @@
|
|||
printf "%s\n" "''${url}"
|
||||
}
|
||||
|
||||
function nixcd () { sakura
|
||||
PACKAGE_NAME="$1"
|
||||
if [[ "$PACKAGE_NAME" = "" ]]; then
|
||||
echo "Usage: nixcd <package name>"
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue