I don’t think I understand what the profile is.
A profile in Nix is a general and convenient concept for realizing rollbacks.
Rollbacks? Of what?
It seems that my profile is persistent because on a new shell it still has something in it. But why? Where does it store what’s in it?
And how did Nix get into my shell? Where does it hook into my PATH and such?
Profiles are probably better explained in the scattered bits about how they are implemented in the file system. There is currently work in progress to unify that: https://github.com/NixOS/nix/pull/8141
Are home-manager and
nix profile doing the same thing?
Home-manager manages programs and their configuration.
When used standalone, then it will use
nix profile to actually create and maintain the information to nix which things are contained in the users “default” profile which gets linked through