From 49fe8d0ee18d17436ee4a0c3d9e8c5ed2f03c67b Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Wed, 15 May 2024 10:51:15 -0600 Subject: [PATCH] configs/zsh: add ni() a convenience wrapper for nix shell --- configs/zsh.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/configs/zsh.nix b/configs/zsh.nix index de8fefe..2e78411 100644 --- a/configs/zsh.nix +++ b/configs/zsh.nix @@ -38,6 +38,21 @@ PROMPT='%n@%m[%(?.%{$fg[default]%}.%{$fg[red]%})%?%{$reset_color%}]:%~$vcs_info_msg_0_$(prompt_char) ' + ni() { + if [ "$#" -eq 0 ]; then + echo "please specify packages to install" + return 1 + fi + + opts=() + for i in $@; do + opts+="nixpkgs#$i" + done + + echo "==> Installing: $opts" + nix shell $opts + } + go_update_deps() { for i in $(go list -m -f '{{if not (or .Indirect .Main)}}{{.Path}}{{end}}' all); do go get -u $i