Absolutely! I'll give you an example. In the NixOS config for my desktop I have the lines:
{
environment.systemPackages = with pkgs; [
firefox
...
];
}
So Firefox is installed every time I build a system with this config. This is just like apt-get install firefox in that very user can use it after installation. The config lives in the respective user's dotfiles (.config/mozilla/firefox) and will of course survive reboots.
What I chose to do additionally (but this is in no way required!) is a home-manager config for my main account with the lines:
{
programs.firefox = {
enable = true;
policies = {
DisableFirefoxAccounts = true;
DisablePocket = true;
DisableTelemetry = true;
DownloadDirectory = "${config.home.homeDirectory}/tmp";
OfferToSaveLogins = false;
...
}
...
}
This is a declarative configuration that basically handles my dotfiles (profiles, extensions, themes, ...) for me. I think you have the impression that this is mandatory, but it is really a very specific behavior through the home-manager module, but you can absolutely run NixOS without it.