Ah, I meant it more as a “for your information”. “XDG specification” sounds fancy, but it’s just a description for where programs should put the config files (& other files they might need).
Ah. I was mistaken about ~/.nix-profile
and ~/.local/state/nix/profiles
.
~/.nix-profile
is a convenient symlink to the user’s current profile.
~/.local/state/nix/profiles
is just a folder where local profiles can go.
e.g. home manager uses that dir for the home-manager profile.
e.g. you can try readlink ~/.local/state/nix/profiles/home-manager
, and this points to e.g. home-manager-15-link
.
– You can look through ~/.local/state/nix/profiles/home-manager-15-link
or so, you’ll see it has /activate
and /bin/home-manager-generation
and other files. – When you run home-manager switch
, this home-manager
profile gets updated to point to a new build.
nix profile install
adds a package to the user’s profile. e.g. running nix profile install nixpkgs#cowsay
means you’ll have cowsay
in ~/.nix-profile/bin
.
nix-env --install
and nix profile install
come with their own footguns. It’s easy to make mistakes when using it that way, causing problems that are difficult to understand (& so are difficult to ask for help for). – It’s often better to just use nix shell nixpkgs#cowsay
, or to use Home Manager, or install a system in a global config. – See e.g.