diff --git a/scripts/nix-profile.sh.in b/scripts/nix-profile.sh.in
index 064a6a347a4a19b3319ad78300c4451df1f597c8..55cff3e62d9c58e9becbb6bcc75cce12cea05c9a 100644
--- a/scripts/nix-profile.sh.in
+++ b/scripts/nix-profile.sh.in
@@ -1,7 +1,7 @@
 if test -n "$HOME"; then
     NIX_LINK="$HOME/.nix-userenv"
 
-    if ! test -a "$NIX_LINK"; then
+    if ! test -L "$NIX_LINK"; then
         echo "creating $NIX_LINK"
         _NIX_DEF_LINK=@localstatedir@/nix/links/current
         ln -s "$_NIX_DEF_LINK" "$NIX_LINK"