âž sudo ./install
Password:
warning: installing Nix as root is not supported by this script!
performing a single-user installation of Nix...
copying Nix to /nix/store................................
initialising Nix database...
warning: the group ‘nixbld’ specified in ‘build-users-group’ does not exist
warning: the group ‘nixbld’ specified in ‘build-users-group’ does not exist
warning: the group ‘nixbld’ specified in ‘build-users-group’ does not exist
installing ‘nix-1.10’
download-from-binary-cache.pl: could not download ‘https://cache.nixos.org/1p6vvyx1n5kgvhwv066qx0x0a358q69f.narinfo’ (Curl error 60)
building path(s) ‘/nix/store/1p6vvyx1n5kgvhwv066qx0x0a358q69f-user-environment’
error: the group ‘nixbld’ specified in ‘build-users-group’ does not exist
./install: unable to install Nix into your default profile
So, to fix this I do:
{18:06}[]~/nix-1.10-x86_64-darwin âž sudo mkdir /etc/nix/
{18:08}[]~/nix-1.10-x86_64-darwin âž sudo nano /etc/nix/nix.conf
âž cat /etc/nix/nix.conf
build-users-group =
And now, install works:
{18:08}[]~/nix-1.10-x86_64-darwin âž sudo ./install
warning: installing Nix as root is not supported by this script!
performing a single-user installation of Nix...
copying Nix to /nix/store................................
initialising Nix database...
installing ‘nix-1.10’
download-from-binary-cache.pl: could not download ‘https://cache.nixos.org/1p6vvyx1n5kgvhwv066qx0x0a358q69f.narinfo’ (Curl error 60)
building path(s) ‘/nix/store/1p6vvyx1n5kgvhwv066qx0x0a358q69f-user-environment’
created 7 symlinks in user environment
installing ‘nss-cacert-3.20’
download-from-binary-cache.pl: could not download ‘https://cache.nixos.org/x3n7q3svl82n8kx4dn9qvx127gbj5xqf.narinfo’ (Curl error 60)
building path(s) ‘/nix/store/x3n7q3svl82n8kx4dn9qvx127gbj5xqf-user-environment’
created 9 symlinks in user environment
downloading Nix expressions from ‘http://nixos.org/releases/nixpkgs/nixpkgs-16.03pre71332.f490186//nixexprs.tar.xz’...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 6090k 100 6090k 0 0 2625k 0 0:00:02 0:00:02 --:--:-- 2627k
unpacking channels...
created 2 symlinks in user environment
Installation finished! To ensure that the necessary environment
variables are set, please add the line
. /Users/blue/.nix-profile/etc/profile.d/nix.sh
to your shell profile (e.g. ~/.profile).
I think the fix is having different default build-user-group settings for nix
This is how I currently got Nix installed on OSX:
#!/bin/bash
set -xe
sudo mkdir -p /nix
sudo chown $USER /nix
sudo mkdir -p /etc/nix
if [ ! -e /etc/nix/nix.conf ]; then
sudo bash -c 'echo "build-users-group =" > /etc/nix/nix.conf'
fi
bash <(curl -s https://nixos.org/nix/install)
source ~/.nix-profile/etc/profile.d/nix.sh
for file in .zshrc .bashrc ; do if [ -e "~/$file" ]; then
echo 'source ~/.nix-profile/etc/profile.d/nix.sh' >> "$file"
fi;
CURL_CA_BUNDLE=$(find /nix -name ca-bundle.crt |tail -n 1) nix-channel --update
Did you perhaps miss the warning? :)
warning: installing Nix as root is not supported by this script!
@dezgeg this is a regression as far as I'm concerned. Getting nix installed in a Docker image worked fine with nix-1.7, as is done in the official Docker image: https://github.com/NixOS/nixpkgs/blob/master/maintainers/docker/Dockerfile. But doesn't work if you change that file to say nix-1.11.2 instead, due to the error in this very ticket.
Getting the same thing on arch, without being root:
~ » curl https://nixos.org/nix/install | sh
performing a single-user installation of Nix...
directory /nix does not exist; creating it by running ‘mkdir -m 0755 /nix && chown vincent /nix’ using sudo
copying Nix to /nix/store...........................
initialising Nix database...
creating /home/vincent/.nix-profile
installing ‘nix-1.11.2’
building path(s) ‘/nix/store/chgli9j96788vf31m98clj5a0n8rgsyy-user-environment’
error: the group ‘nixbld’ specified in ‘build-users-group’ does not exist
nix-binary-tarball-unpack/nix-1.11.2-x86_64-linux/install: unable to install Nix into your default profile
Running into the same issue, as I'm trying to install nix in a Docker image.
The instructions in https://github.com/NixOS/nixpkgs/blob/master/maintainers/docker/Dockerfile work only for the older nix versions, but those are not compatible with newer packages and thus installing those packages fail.
We should really abort on warning: installing Nix as root is not supported by this script!
I'm afraid I don't really understand why installing as root shouldn't be supported. I see that it isn't (and I personally will continue to apply hammers till it works). Why doesn't the nix community want to support it?
At the moment, this makes installing nix at system configuration time (such as via chef) someone irritating as I have to apply work arounds so that I don't need to create a 'nix' user just to make the install work.
At the moment, this makes installing nix at system configuration time (such as via chef) someone irritating as I have to apply work arounds so that I don't need to create a 'nix' user just to make the install work.
Same here. An additional extremely common use case already mentioned above by a couple of users is: firing up a quick Docker image.
Makes sense to support that, I think.
Meanwhile you can use https://hub.docker.com/r/nixos/nix/
@domenkozar problem I have with that Docker image is - where do I find its corresponding Dockerfile? The one here is clearly not the source, since it's stuck on nix-1.7 whereas the latest on DockerHub uses nix-1.11.2. This is problematic in particular whenever I need to override the ENTRYPOINT: I'd like to be able to call the old ENTRYPOINT but I don't know where it is...
@mboes at the bottom of https://hub.docker.com/r/nixos/nix/ is the link to the Dockerfile.
Thanks
Being root or not has absolutely nothing to do with the actual error:
error: the group ‘nixbld’ specified in ‘build-users-group’ does not exist
Apple doesn't supply a nixbld user by default on their operating system, unfortunately... Neither does arch or ubuntu. :)
Most helpful comment
Being root or not has absolutely nothing to do with the actual error:
Apple doesn't supply a
nixblduser by default on their operating system, unfortunately... Neither does arch or ubuntu. :)