I'm new to NixOS and trying to learn its concepts. One of the reasons I'm excited about it is I'm hoping it will be able to give me a reproducible system configuration, similar to using Ansible for localhost. However, I am not sure how to achieve this.
I am aware of environment.systemPackages
in /etc/nixos/configuration.nix
, but these are system-wide packages only. I also know that the nix-env
command can install a package for a user, but I'd rather declare such a package in a file that I can check into source control.
Is there a particular file I can configure (similar to a playbook) where I could declare a set of packages for a user? Or at least specify its "user environment" or "profiles" (not sure which term is correct)?
Ideally I could take a few files, copy them to another computer, run a command, and it's at the same state as the old computer, including multiple users with different sets of packages.
Finally, does my use case mean that I should never use nix-env
to install packages?