How do I configure users and install system-wide packages on Debian via Nix Package Manager?

I have set up a multi-user Nix Package Manager on Debian, and I have been trying to figure out two things:

First, how do I install packages so they would be available to all users system wide? I have been unable to figure out what file to use for this purpose – the closest I can find are to use “buildEnv.nix” or Home Manager, but both solutions seem to configure things on a per-user basis, rather than a system-wide one.

Second, is it possible to include users in this file, or is this a system configuration that is different from distro to distro, and thus necessarily unreasonable to be handled by Nix Package Manager?

Come to think of it, I have a third question as well: would it be possible to install AwesomeWM, either system-wide, or even per-user? I have a vague sense that this is out of reach for Nix Package Manager, but I’d like to know if I’m wrong about it! (It would be nice to experiment with Awesome via Nix rather than via apt!)

Ususally, you don’t. Users can share the common nix store, making programs visible in the user environment must be done on a per-user basis, e.g. with home-manager. The individual user environments can be set up from a shared git repo to keep them in sync.

BUT

With the magic of GitHub - numtide/system-manager: Manage system config using nix on any distro you can define system-wide packages like you would on NixOS.

1 Like