If the `home-manager` module is enabled then check if the `home-manager` package is installed using `nix-env -i` and if so then it is automatically uninstalled before the new package environment, which includes home-manager, is installed.
home.activation.checkLinkTargets