Switching between nix-env and nix profile

I made the mistake of messing around with nix profile commands while not on a flake setup and I’m now having difficulty undoing the change that occurred.

Came across Nix command - NixOS Wiki which says in order to “migrate back to nix-env you can delete your current profile”, but when I attempt to do so, it fails with rm: cannot remove '/home/$USER/.local/state/nix/profiles/profile/manifest.json': Read-only file system

Any assistance with fixing this would be much appreciated.

Figured it out. Did not realize the wiki page was missing some information, user vs root profiles. Deleting the user profile via rm -rf "${XDG_STATE_HOME-$HOME/.local/state}/nix/profiles/profile" sorted it out.