Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install.sh homepage instructions only work without build-user-group #697

Open
vizanto opened this issue Nov 13, 2015 · 18 comments
Open

install.sh homepage instructions only work without build-user-group #697

vizanto opened this issue Nov 13, 2015 · 18 comments

Comments

@vizanto
Copy link
Contributor

vizanto commented Nov 13, 2015

➭ 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).
@vizanto
Copy link
Contributor Author

vizanto commented Nov 18, 2015

I think the fix is having different default build-user-group settings for nix

@vizanto
Copy link
Contributor Author

vizanto commented Nov 22, 2015

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

@dezgeg
Copy link
Contributor

dezgeg commented Dec 6, 2015

Did you perhaps miss the warning? :)

warning: installing Nix as root is not supported by this script!

@mboes
Copy link

mboes commented Feb 21, 2016

@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.

@Keats
Copy link

Keats commented Mar 1, 2016

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

@kommen
Copy link

kommen commented Jun 2, 2016

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.

@domenkozar
Copy link
Member

We should really abort on warning: installing Nix as root is not supported by this script!

@linuxfood
Copy link

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.

@mboes
Copy link

mboes commented Aug 17, 2016

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.

@domenkozar
Copy link
Member

Makes sense to support that, I think.

Meanwhile you can use https://hub.docker.com/r/nixos/nix/

@mboes
Copy link

mboes commented Aug 17, 2016

@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...

@domenkozar
Copy link
Member

@mboes at the bottom of https://hub.docker.com/r/nixos/nix/ is the link to the Dockerfile.

@mboes
Copy link

mboes commented Aug 17, 2016 via email

@vizanto
Copy link
Contributor Author

vizanto commented Aug 22, 2016

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. :)

@stale
Copy link

stale bot commented Feb 15, 2021

I marked this as stale due to inactivity. → More info

@stale
Copy link

stale bot commented Sep 19, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Sep 19, 2021
@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixosstag.fcio.net/t/warning-nix-search-path-entry-nix-var-nix-profiles-per-user-root-channels-does-not-exist-ignoring/5170/1

@stale stale bot removed the stale label Nov 2, 2021
@stale
Copy link

stale bot commented May 2, 2022

I marked this as stale due to inactivity. → More info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests