Handle <nixpkgs> being a symlink

Fixes #1898.