Skip to content

Commit

Permalink
When supplying a file with eg. nix-build take the realpath of it
Browse files Browse the repository at this point in the history
  • Loading branch information
hedning committed Nov 13, 2017
1 parent 9ef8e1f commit ddcef1e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions _nix
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,9 @@ function _nix_legacy () {
fi
elif [[ ${line[1]} ]]; then
local file="$(dequote ${line[1]})"
if [[ -e "$file" ]]; then
file="$(realpath $file)"
fi
defexpr_path="import $file {}"
elif [[ -e shell.nix && "${words[0]}" == nix-shell ]]; then
defexpr_path="import $(realpath shell.nix) {}"
Expand Down

0 comments on commit ddcef1e

Please sign in to comment.