Run darwin-rebuild switch (requires sudo for system activation).
After a successful switch, re-registers nix .app bundles with LaunchServices
so Spotlight displays correct icons.
Ensure home-manager profile directories exist.
Determinate Nix on fresh macOS doesn’t create per-user profile dirs,
which causes home-manager to fail with “Could not find suitable profile directory”.
Also fixes ~/.local ownership if the install script created it as root.
Resolve the path to the nix binary.
Checks well-known locations first, then falls back to PATH-based lookup.
Preferring hardcoded paths prevents PATH-based binary injection.