Profiles
Updated: June 25, 2025
A user can have their own profile or can share a profile with other users.
Usually located in /nix/var/nix/profiles
Having a different profile is like having a separate user account.
Profile should not be underestimated. This is a crucial feature of NixOS.
Without it, it is more difficult to maintain the system regarding boot versions!!
Profiles are immune to garbage collection. (use wipe-history for that)
Commands
# create profile from a rebuilt (I use for stable checkpoints)
sudo nixos-rebuild switch --flake flake_path -p profile_name
# change profile
--switch-profile <profile-name>
# rollback one profile version
nix profile rollback
# rollback profile to specific version
nix profile rollback --to 418
Subcommands
diff-closures # diff between profiles
history # show changes between each version of default profile
install # install a package into a profile
list # list installed packages
remove # remove a package from a profile
rollback # rollback to previous version of profile
upgrade # upgrade packages to most recent flake
wipe-history # delete all non current versions of a profile