When to Use 'environment.systemPackages' vs. 'users.users.<name>.packages'?

There are two main ways to install applications and programs: environment.systemPackages and users.users.<name>.packages. While I’ve been using environment.systemPackages to install everything for simplicity, are there advantages to using users.users.<name>.packages for specific programs, or vice versa?

Hey there!

Ultimately, all installed applications end up in the Nix Store, regardless of installation method. The only difference is their availability (in a convenient way, e.g. through an app launcher) for different users of the same system. The description of the users.users.<name>.packages option on NixOS Search reads:

The set of packages that should be made available to the user. This is in contrast to environment.systemPackages, which adds packages to all users.

I don’t think that’s what they were asking. They’re asking why/when you’d prefer to use one over the other.

Hm, I thought my reply implicitly addresses that question:

A: “Why would you prefer to use one over the other (for application P)?”
B: “It depends on whether you want to make application P easily available to every user or not.”

I don’t see any advantages apart from that. But maybe I’m just missing something? :see_no_evil: :smiley: