Add 'hey search' command

Shortcut for nix search nixpkgs $@
This commit is contained in:
Henrik Lissner 2020-10-11 23:51:23 -04:00
parent 56f545279f
commit b3fee313d0
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 5 additions and 2 deletions

View file

@ -10,6 +10,7 @@
# dots u|update -> nix flake update --recreate-lock-file $DOTFILES # dots u|update -> nix flake update --recreate-lock-file $DOTFILES
# dots re|rebuild -> nixos-rebuild --flake $DOTFILES#$HOSTNAME ${1:-build} # dots re|rebuild -> nixos-rebuild --flake $DOTFILES#$HOSTNAME ${1:-build}
# dots rollback -> dots rebuild --rollback switch # dots rollback -> dots rebuild --rollback switch
# dots s|search -> nix search nixpkgs $@
# dots vm -> dots rebuild vm # dots vm -> dots rebuild vm
# dots up|upgrade -> dots update && dots rebuild switch # dots up|upgrade -> dots update && dots rebuild switch
# dots gc -> GC user profile, optimise nix store # dots gc -> GC user profile, optimise nix store
@ -90,8 +91,9 @@ function main {
rollback) _rebuild --rollback switch ;; rollback) _rebuild --rollback switch ;;
vm) _rebuild "$@" vm ;; vm) _rebuild "$@" vm ;;
u|update) _update "$@" ;; u|update) _update "$@" ;;
up|upgrade) _update && _rebuild switch ;; up|upgrade) _update && _rebuild switch ;;
s|search) nix search nixpkgs "$@" ;;
gc) _gc "$@" ;; gc) _gc "$@" ;;
push) push)

View file

@ -26,6 +26,7 @@ _hey () {
b|build) _hey_dispatch nix-build ;; b|build) _hey_dispatch nix-build ;;
ch|check) _hey_dispatch nix flake check ;; ch|check) _hey_dispatch nix flake check ;;
sh|show) _hey_dispatch nix flake show ;; sh|show) _hey_dispatch nix flake show ;;
s|search) _hey_dispatch nix search nixpkgs ;;
-*) _hey_dispatch nix-env ;; -*) _hey_dispatch nix-env ;;
*) _message "Command not found: ${words[2]}" ;; *) _message "Command not found: ${words[2]}" ;;
esac esac