Skip to content

Commit

Permalink
🐛 Fix nix-env
Browse files Browse the repository at this point in the history
  • Loading branch information
Freed-Wu committed Jan 12, 2024
1 parent 1478335 commit 5abb5aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
1 change: 0 additions & 1 deletion functions/main.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
finger() {command pinky $@} || finger() {command whoami}
(($+commands[pandoc])) || pandoc() {command cat ${@[-1]}}
(($+commands[grc])) || grc() {eval ${@[2,-1]}}
(($+commands[jq])) || jq() {echo ';'}

(($+commands[git])) && git() {
command git $@ | eval $(command git config --global pager.$1 || echo cat)
Expand Down
13 changes: 9 additions & 4 deletions sources/nix-env.zsh
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
# :fzf-tab:complete:(\\|*/|)nix-env:*
(($+commands[jq])) && view_json() {
${src:h:h}/bin/nix-env.jq | mdcat
} || view_json() {
bat --color=always -pljson
}

case $group in
'Attribute path')
nix-env -qa --out-path --json --meta -A $ctxt[hpre]$word |
${src:h:h}/bin/nix-env.jq | mdcat
nix-env -qa --out-path --json --meta -A $ctxt[hpre]$word | view_json
;;
'Installed package'*)
nix-env -q --out-path --json --meta $word | ${src:h:h}/bin/nix-env.jq | mdcat
nix-env -q --out-path --json --meta $word | view_json
;;
'Local file')
'Store path to package')
less $realpath
;;
esac

0 comments on commit 5abb5aa

Please sign in to comment.