all repos — nixfiles @ 5f0bf56a3a51099b77e5d3b45a29e77ee6b5c3ea

System and user configuration, managed by nix and home-manager

user/settings/fish/functions/padd.fish (view raw)

1
2
3
4
5
6
7
8
9
10
11
12
function padd --description 'add nix packages to PATH temporarily'
  for pkg in $argv
     set --local out $(nix-build '<nixpkgs>' --attr "$pkg.out" --no-out-link --quiet)
     set --local bin $out/bin
     if ! path is --type dir $bin
       echo "$bin doesn't exist"
     else
       fish_add_path --global $bin
       echo "$bin"
     end
  end
end