diff --git a/src/nix/upgrade-nix.cc b/src/nix/upgrade-nix.cc index 666ac68b0..2db60922a 100644 --- a/src/nix/upgrade-nix.cc +++ b/src/nix/upgrade-nix.cc @@ -113,7 +113,7 @@ struct CmdUpgradeNix : MixDryRun, StoreCommand Path profileDir = dirOf(where); // Resolve profile to /nix/var/nix/profiles/ link. - while (baseNameOf(dirOf(canonPath(profileDir))) != "profiles") + while (baseNameOf(dirOf(canonPath(profileDir))) != "profiles" && isLink(profileDir)) profileDir = readLink(profileDir); printInfo("found profile '%s'", profileDir);