What is the simplest way to check if one has single or multi-user Nix installed?

As far as I can tell, one can just issue

cat /etc/group | grep nixbld

and if there is an output then it is a multi-user install, right?

Hehe. I’m not sure there’s a good way. I recall seeing this general need come up in https://github.com/NixOS/nix/issues/3630

This is a probably a decent signal for some purposes, but it would be wrong if someone had an old multi-user install that hasn’t been completely cleaned.

(aside, you can just grep nixbld /etc/group)

1 Like

Yeah, my solution sounded too simple to be true…:slight_smile: Thanks for the issue (at least I know I’m not alone) and also for the CLI-golf; I keep forgetting this form of grep.

(Off-topic, but also thank you for compiling this list of Nix issues!)

1 Like

What I settled on was to test it /nix/store is owned by root with the sticky bit. There’s a long explanatory comment in this code

Also to note, checking for the nixbld group won’t work if a multi-user install was replaced with a single-user install without fully cleaning it up first. This is true of testing pretty much anything outside of /nix/store.

4 Likes
nix-shell -p nix-info --run "nix-info -m"
2 Likes

shouldn’t this simple information be part of nix doctor ? (as well as the rest of nix-info)

Hosted by Flying Circus.