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?
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
)
Yeah, my solution sounded too simple to be true… 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!)
What I settled on was to test if /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
.
nix-shell -p nix-info --run "nix-info -m"
shouldn’t this simple information be part of nix doctor
? (as well as the rest of nix-info)