9

I have been trying to follow the Nix wiki to install Nix on a custom path /scratch/gopinath/nix. The /nix path is not accessible to me due to the restrictions on the system provided by my university. The PRoot option does not fit my requirements. I also do not have root access.

Environment:

| uname -a
Linux hati.eecs.oregonstate.edu 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Dec 13 06:58:20 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
| cat /etc/redhat-release
Red Hat Enterprise Linux Workstation release 6.5 (Santiago)
| gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4)

My efforts

This is what I have tried so far; I used the below script install.sh on the extracted folder /scratch/gopinath/usr/nix-boot

#!/bin/bash
set -e
export nix_boot=${NIX_BOOT-/scratch/gopinath/usr/nix-boot}
export nix_root=${NIX_ROOT-/scratch/gopinath/nix}
export RUN_EXPENSIVE_TESTS=no
export PATH=$nix_boot/bin:/scratch/gopinath/usr/bin:$PATH
export PKG_CONFIG_PATH=$nix_boot/lib/pkgconfig:$PKG_CONFIG_PATH
export LDFLAGS="-L$nix_boot/lib -L$nix_boot/lib64 $LDFLAGS"
export LD_LIBRARY_PATH="$nix_boot/lib:$nix_boot/lib64:$LD_LIBRARY_PATH"
export CPPFLAGS="-I$nix_boot/include $CPPFLAGS"
#export PERL5OPT="-I$nix_boot/lib/perl"
export PERL5OPT="-I$nix_boot/lib64/perl5"
export NIXPKGS=/scratch/gopinath/nixpkgs
all="bzip2 curl sqlite dbi dbd wwwcurl bootstrap nix"
case $1 in
  -h) echo $all nix1.8; exit 0;;
  -sh) $2; exit 0;;
bzip2)
(cd bzip2-1.0.6;
  make -f Makefile-libbz2_so;
  make install PREFIX=$nix_boot;
  cp libbz2.so.1.0 libbz2.so.1.0.6 $nix_boot/lib; ) ;;

curl)
(cd curl-7.35.0/;
  ./configure --prefix=$nix_boot;
  make;
  make install; ) ;;

sqlite)
(cd sqlite-autoconf-3080300/;
  ./configure --prefix=$nix_boot;
  make;
  make install; ) ;;

libxml2)
  (cd libxml2-2.9.2; ./configure --prefix=$nix_boot;
  make;
  cp ./libxml2-2.9.2/xmllint $nix_boot/bin
  # make install;
  ) ;;

libxslt)
  (cd libxslt-1.1.28;  ./configure --prefix=$nix_boot;
  make;
  make install; ) ;;

gcc)
  (cd gcc-4.9.2; ./contrib/download_prerequisites; )
  rm -rf gcc-objs;
  mkdir -p gcc-objs
  (cd gcc-objs; ./../gcc-4.9.2/configure --prefix=$nix_boot;
  make;
  make install; ) ;;

bison)
  (cd bison-3.0; ./configure --prefix=$nix_boot;
  make;
  make install; ) ;;

flex)
  (cd flex-2.5.39;  ./configure --prefix=$nix_boot;
  make;
  make install; );;

coreutils)
  (cd coreutils-8.23;  ./configure --enable-install-program=hostname --prefix=$nix_boot;
  make;
  make install; );;

bash)
  (cd bash-4.3;  ./configure --prefix=$nix_boot;
  make;
  make install; );;

dbi)
(cd DBI-1.631/;
  perl Makefile.PL PREFIX=$nix_boot PERLMAINCC=$nix_boot/bin/gcc;
  make;
  make install; ) ;;

dbd)
(cd DBD-SQLite-1.40/;
  perl Makefile.PL PREFIX=$nix_boot PERLMAINCC=$nix_boot/bin/gcc;
  make;
  make install; ) ;;

wwwcurl)
(cd WWW-Curl-4.15;
  perl Makefile.PL PREFIX=$nix_boot PERLMAINCC=$nix_boot/bin/gcc;
  make;
  make install; ) ;;

bootstrap)
rm -rf nix
git clone https://github.com/NixOS/nix nix
(cd nix;
  ./bootstrap.sh ) ;;

nix)
(cd nix;
  echo "./configure --prefix=$nix_boot --with-store-dir=$nix_root/store --localstatedir=$nix_root/var" > myconfig.sh;
  ./configure --prefix=$nix_boot --with-store-dir=$nix_root/store --localstatedir=$nix_root/var --with-coreutils-bin=/scratch/gopinath/usr/bin --enable-static  --enable-static-nix ;
  /usr/bin/perl -pi -e 's#--nonet# #g' doc/manual/local.mk;
  echo "GLOBAL_LDFLAGS += -lpthread" >> doc/manual/local.mk;
  make;
  make install; ) ;;

nixconfig)
  nix-channel --add http://nixos.org/channels/nixpkgs-unstable && \
  nix-channel --update && \
  nix-env -iA nix -f $NIXPKGS ;
 ;;

all) for i in $all;
     do env nix_boot=$nix_boot nix_root=$nix_root ./$0 $i ;
     done ;;

*) echo $all;
   echo nix_root=$nix_root
   echo nix_boot=$nix_boot;;
esac

Every thing works fine until I hit the nix. On both nix 1.8 and on nix from the repository, I get

bash-4.1$ make
Makefile:28: Makefile.config: No such file or directory
  GEN    Makefile.config
  GEN    doc/manual/manual.is-valid
-:1: parser error : Document is empty

^
-:1: parser error : Start tag expected, '<' not found

^
make: *** [doc/manual/manual.is-valid] Error 1

If I do make clean and then make I get

bash-4.1$ make
Makefile:28: Makefile.config: No such file or directory
  GEN    Makefile.config
  GEN    doc/manual/version.txt
  GEN    doc/manual/manual.xmli
doc/manual/command-ref/nix-env.xml:203: element include: XInclude error : failed build URL
doc/manual/command-ref/nix-env.xml:1368: element include: XInclude error : failed build URL
doc/manual/command-ref/nix-build.xml:129: element include: XInclude error : failed build URL
doc/manual/command-ref/nix-build.xml:184: element include: XInclude error : failed build URL
doc/manual/command-ref/nix-shell.xml:143: element include: XInclude error : failed build URL
doc/manual/command-ref/nix-shell.xml:195: element include: XInclude error : failed build URL
doc/manual/command-ref/nix-store.xml:119: element include: XInclude error : failed build URL
doc/manual/command-ref/nix-store.xml:1346: element include: XInclude error : failed build URL
doc/manual/command-ref/nix-instantiate.xml:166: element include: XInclude error : failed build URL
doc/manual/command-ref/nix-instantiate.xml:258: element include: XInclude error : failed build URL
  GEN    doc/manual/manual.is-valid
-:1: parser error : Document is empty

^
-:1: parser error : Start tag expected, '<' not found

^
make: *** [doc/manual/manual.is-valid] Error 1

On debug, it seems that xsltproc is called with --nonet flag as in

file: doc/manual/local.mk 

$(d)/manual.is-valid: $(d)/manual.xmli
/scratch/gopinath/usr/nix-boot/bin/xsltproc --nonet \
  --param section.autolabel 1 \
  --param section.label.includes.component.label 1 \
  --param html.stylesheet \'style.css\' \
  --param xref.with.number.and.title 1 \
  --param toc.section.depth 3 \
  --param admon.style \'\' \
  --param callout.graphics.extension \'.gif\' \
  --param contrib.inline.enabled 0 \
  --stringparam generate.toc "book toc" \
  --param keep.relative.image.uris 0 \
  --novalid \
  --stringparam profile.condition manual \
           http://docbook.sourceforge.net/release/xsl-ns/1.78.1/profiling/profile.xsl \
           doc/manual/manual.xmli \
  | /scratch/gopinath/usr/nix-boot/bin/xmllint --nonet --noout --relaxng http://docbook.org/xml/5.0/rng/docbook.rng -

It seems nonet flag is messing with me here somehow, even when using the latest xmllint and xsltproc (mentioned in the install script above).

bash-4.1$ which xsltproc
/scratch/gopinath/usr/nix-boot/bin/xsltproc
bash-4.1$ /scratch/gopinath/usr/nix-boot/bin/xsltproc --version
Using libxml 20902, libxslt 10128 and libexslt 817
xsltproc was compiled against libxml 20902, libxslt 10128 and libexslt 817
libxslt 10128 was compiled against libxml 20902
libexslt 817 was compiled against libxml 20902
bash-4.1$ which xmllint
/scratch/gopinath/usr/nix-boot/bin/xmllint
bash-4.1$ /scratch/gopinath/usr/nix-boot/bin/xmllint --version
/scratch/gopinath/usr/nix-boot/bin/xmllint: using libxml version 20902
   compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 FTP HTTP DTDValid HTML Legacy C14N Catalog XPath XPointer XInclude Iconv ISO8859X Unicode Regexps Automata Expr Schemas Schematron Modules Debug Zlib Lzma 

So I did perl -pi -e 's#--nonet# #g' on doc/manual/local.mk as I mention in the above script.

It now seems that the C11 support in GCC 4.4.7 (default) is insufficient. So I am updated my GCC to 4.9.2 and installed it to the same location (updated in the above script). Now my error on building nix is

$ make
...
configure: creating ./config.status
config.status: creating config.h
config.status: config.h is unchanged
  GEN    Makefile.config
  CXX    src/nix-hash/nix-hash.o
  CXX    src/libmain/shared.o
  CXX    src/libmain/stack.o
  CXX    src/libstore/build.o
  CXX    src/libstore/derivations.o
  CXX    src/libstore/gc.o
  CXX    src/libstore/globals.o
  GEN    src/libstore/schema.sql.hh
  CXX    src/libstore/local-store.o
  CXX    src/libstore/misc.o
  CXX    src/libstore/optimise-store.o
  CXX    src/libstore/pathlocks.o
  CXX    src/libstore/references.o
  CXX    src/libstore/remote-store.o
  CXX    src/libstore/store-api.o
  CXX    src/libutil/affinity.o
  CXX    src/libutil/archive.o
  CXX    src/libutil/hash.o
  CXX    src/libutil/regex.o
  CXX    src/libutil/serialise.o
  CXX    src/libutil/util.o
  CXX    src/libutil/xml-writer.o
  CXX    src/boost/format/format_implementation.o
  CXX    src/boost/format/free_funcs.o
  CXX    src/boost/format/parsing.o
  LD     src/boost/format/libnixformat.so
  LD     src/libutil/libnixutil.so
  LD     src/libstore/libnixstore.so
  LD     src/libmain/libnixmain.so
  LD     src/nix-hash/nix-hash
/usr/bin/ld: src/nix-hash/nix-hash: undefined reference to symbol '__pthread_key_create@@GLIBC_2.2.5'
/usr/bin/ld: note: '__pthread_key_create@@GLIBC_2.2.5' is defined in DSO /lib64/libpthread.so.0 so try adding it to the linker command line
/lib64/libpthread.so.0: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make: *** [src/nix-hash/nix-hash] Error 1
zsh: exit 1     ./install.sh nix

I worked around this error by modifying doc/manual/local.mk by adding a line GLOBAL_LDFLAGS += -lpthread. Now the error is

  CXX    src/libexpr/parser-tab.o
In file included from src/libexpr/parser-tab.cc:255:0:
src/libexpr/parser-tab.hh:124:15: error: redefinition of ‘union YYSTYPE’
 typedef union YYSTYPE
               ^
In file included from src/libexpr/parser.y:53:0:
src/libexpr/parser-tab.hh:124:15: error: previous definition of ‘union YYSTYPE’
 typedef union YYSTYPE
               ^
In file included from src/libexpr/parser-tab.cc:255:0:
src/libexpr/parser-tab.hh:147:10: error: invalid type in declaration before ‘;’ token
 } YYSTYPE;
          ^
src/libexpr/parser-tab.hh:147:10: error: conflicting declaration ‘typedef int YYSTYPE’
In file included from src/libexpr/parser.y:53:0:
src/libexpr/parser-tab.hh:147:3: note: previous declaration as ‘typedef union YYSTYPE YYSTYPE’
 } YYSTYPE;
   ^
make: *** [src/libexpr/parser-tab.o] Error 1

And apparently this was because my bison was old

| yacc -V       
yacc - 1.9 20070509
| bison -V
bison (GNU Bison) 2.4.1

I updated this to bison 3.0 (in the script above), and the errors went away, but flex needs to be updated

  GEN    Makefile.config
  CXX    src/libexpr/parser-tab.o
In file included from src/libexpr/parser-tab.cc:255:0:
src/libexpr/parser-tab.hh:124:15: error: redefinition of ‘union YYSTYPE’
 typedef union YYSTYPE
               ^
In file included from src/libexpr/parser.y:53:0:
src/libexpr/parser-tab.hh:124:15: error: previous definition of ‘union YYSTYPE’
 typedef union YYSTYPE
               ^
In file included from src/libexpr/parser-tab.cc:255:0:
src/libexpr/parser-tab.hh:147:10: error: invalid type in declaration before ‘;’ token
 } YYSTYPE;
          ^
src/libexpr/parser-tab.hh:147:10: error: conflicting declaration ‘typedef int YYSTYPE’
In file included from src/libexpr/parser.y:53:0:
src/libexpr/parser-tab.hh:147:3: note: previous declaration as ‘typedef union YYSTYPE YYSTYPE’
 } YYSTYPE;
   ^

And updating to flex 2.5.39 seems to remove the remaining errors. Now, on adding the channel

bash-4.1$ nix-channel --add http://nixos.org/channels/nixpkgs-unstable
Can't load '/scratch/gopinath/usr/nix-boot/lib/perl5/site_perl/5.10.1/x86_64-linux-thread-multi/auto/Nix/Store/Store.so' for module Nix::Store: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /scratch/gopinath/usr/nix-boot/lib/perl5/site_perl/5.10.1/x86_64-linux-thread-multi/auto/Nix/Store/Store.so) at /usr/lib64/perl5/XSLoader.pm line 70.
 at /scratch/gopinath/usr/nix-boot/lib/perl5/site_perl/5.10.1/x86_64-linux-thread-multi/Nix/Store.pm line 38
Compilation failed in require at /scratch/gopinath/usr/nix-boot/lib/perl5/site_perl/5.10.1/x86_64-linux-thread-multi/Nix/Manifest.pm line 13.
BEGIN failed--compilation aborted at /scratch/gopinath/usr/nix-boot/lib/perl5/site_perl/5.10.1/x86_64-linux-thread-multi/Nix/Manifest.pm line 13.
Compilation failed in require at /scratch/gopinath/usr/nix-boot/bin/nix-channel line 8.
BEGIN failed--compilation aborted at /scratch/gopinath/usr/nix-boot/bin/nix-channel line 8.

This was resolved by setting LD_LIBRARY_PATH to look in $nix_boot/lib64 After that, the guide asks me to install nix with

bash-4.1$ cat ~/.nixpkgs/config.nix 
pkgs:
{
  packageOverrides = self: {
    nix = self.nix.override {
      storeDir = "/scratch/gopinath/nix/store";
      stateDir = "/scratch/gopinath/nix/var";
    };
  };
}

bash-4.1$ nix-env -iA nix
error: attribute ‘nix’ in selection path ‘nix’ not found

It seems that here is a solution. So,

$ nix-env -iA nix -f ~/.nix-defexpr/channels/nixpkgs
...
building tests/test-suite.log
make[5]: Entering directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23'
building all
make  all-recursive
make[6]: Entering directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23'
building all-recursive
Making all in po
make[7]: Entering directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23/po'
building check-macro-version
make[7]: Leaving directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23/po'
Making all in .
make[7]: Entering directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23'
make[7]: Nothing to be done for `all-am'.
make[7]: Leaving directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23'
Making all in gnulib-tests
make[7]: Entering directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23/gnulib-tests'
building all
make  all-recursive
make[8]: Entering directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23/gnulib-tests'
building all-recursive
Making all in .
make[9]: Entering directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23/gnulib-tests'
make[9]: Nothing to be done for `all-am'.
make[9]: Leaving directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23/gnulib-tests'
make[8]: Leaving directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23/gnulib-tests'
make[7]: Leaving directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23/gnulib-tests'
make[6]: Leaving directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23'
make[5]: Leaving directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23'
...
============================================================================
Testsuite summary for GNU coreutils 8.23
============================================================================
# TOTAL: 563
# PASS:  439
# SKIP:  120
# XFAIL: 0
# FAIL:  3
# XPASS: 0
# ERROR: 1
============================================================================
See ./tests/test-suite.log
Please report to bug-coreutils@gnu.org
============================================================================
make[4]: *** [tests/test-suite.log] Error 1
make[4]: Leaving directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23'
make[3]: *** [check-TESTS] Error 2
make[3]: Leaving directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23'
make[2]: *** [check-am] Error 2
make[2]: Leaving directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23'
make: *** [check] Error 2
builder for ‘/scratch/gopinath/nix/store/1rcj45a27mz06rlw354k1zzwvz0wf24k-coreutils-8.23.drv’ failed
 with exit code 2
cannot build derivation ‘/scratch/gopinath/nix/store/m2v75p5m7irqh0z2af5idypkil9v630m-stdenv.drv’: 1
 dependencies couldn't be built
cannot build derivation ‘/scratch/gopinath/nix/store/sp3ic057ydmkv4cnxrbgz016ivy3lac3-nix-1.8.drv’: 
1 dependencies couldn't be built
error: build of ‘/scratch/gopinath/nix/store/sp3ic057ydmkv4cnxrbgz016ivy3lac3-nix-1.8.drv’ failed

So core-utils fails. Now what do I do? The error test is

...
ERROR: tests/chown/separator
============================

id: cannot find name for user ID 44172
separator.sh: set-up failure: 
...

And fails are

FAIL: tests/misc/help-version
=============================

0+1 records in
0+1 records out
whoami: cannot find name for user ID 44172
FAIL: whoami
FAIL: tests/id/uid
==================

id: cannot find name for user ID 44172
id: : no such user
id: 44172: no such user
id: 44172: no such user
id: +44172: no such user
id: 44172: no such user
id: 44172: no such user
id: +44172: no such user
id: 44172: no such user
id: 44172: no such user
id: +44172: no such user
...
FAIL: tests/id/zero
===================

id: cannot find name for user ID 44172
uid=44172 gid=16473 groups=16473,5087,5105,10550,12244,13985,14073,20416
id: 44172: no such user
id: 44172: no such user
....
id: cannot find name for group ID 16473
id: cannot find name for group ID 16473
....
--- exp 2015-04-12 04:20:21.655856440 +0000
+++ out2        2015-04-12 04:20:21.660856355 +0000
@@ -1,5 +1,17 @@
@@ -1,5 +1,17 @@

-id -g[z] 44172: id -gn[z] 44172: id -gr[z] 44172: id -grn[z] 44172: id -G[z] 44172: id -Gn[z] 44172
: id -Gr[z] 44172: id -Grn[z] 44172: id -u[z] 44172: id -un[z] 44172: id -ur[z] 44172: id -urn[z] 44
172: id -g[z] root: 0
+id -g[z] 44172: 
+id -gn[z] 44172: 
...

So I installed coreutils-8.23 on the same prefix, and tried again. Unfortunately, the above test errors anyway. It seems that it is always trying to use the system id irrespective of the path settings.

Updates

I would like to disable thedoChecks in the coreutils-8.23.drv file. So I cloned the repo https://github.com/nixos/nixpkgs and set NIXPKGS enviornment variable pointing to it. Next, I modify the pkgs/tools/misc/coreutils/default.nix so that doCheck = false always. Next I executed

nix-env -iA nix -f $NIXPKGS
...
FAIL: tests/dump-db.sh
running test tests/case-hack.sh
+ clearStore
+ echo 'clearing store...'
clearing store...
+ chmod -R +w /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/store
+ rm -rf /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/store
+ mkdir /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/store
+ rm -rf /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/db
+ mkdir /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/db
+ nix-store --init
+ clearProfiles
+ profiles=/tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/var/nix/profiles
+ rm -rf /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/var/nix/profiles
+ rm -f /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/var/nix/gcroots/auto/mqgm5a11kh8r74bbz2gzygddh00lakss
+ rm -f /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/var/nix/gcroots/ref
+ rm -rf /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/case
+ opts='--option use-case-hack true'
+ nix-store --option use-case-hack true --restore /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/case
+ nix-store --option use-case-hack true --dump /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/case
+ cmp case.nar /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/case.nar
++ nix-hash --option use-case-hack true --type sha256 /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/case
++ nix-hash --flat --type sha256 case.nar
+ '[' ccd0c2353fbb6ff6853088e01f0557e8b9cbc9d11d2e1f8435175dc08091c2a3 = ccd0c2353fbb6ff6853088e01f0557e8b9cbc9d11d2e1f8435175dc08091c2a3 ']'
+ touch /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/case/xt_CONNMARK.h~nix~case~hack~3
+ nix-store --option use-case-hack true --dump /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/case
error: file name collision in between ‘/tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/case/xt_CONNMARK.h’ and ‘/tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/case/xt_CONNMARK.h~nix~case~hack~3’
PASS: tests/case-hack.sh
running test tests/check-reqs.sh
+ RESULT=/tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/result
+ nix-build -o /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/result check-reqs.nix -A test1
download-from-binary-cache.pl: cannot figure out user name at /scratch/gopinath/nix/store/9313bj65al5bm42q6fiw7y74ayjxli1h-nix-1.8/libexec/nix/substituters/download-from-binary-cache.pl line 48.
error: substituter ‘download-from-binary-cache.pl’ died unexpectedly
FAIL: tests/check-reqs.sh
30 out of 42 tests failed 
mk/tests.mk:11: recipe for target 'installcheck' failed
make: *** [installcheck] Error 1
builder for ‘/scratch/gopinath/nix/store/fl8hcbq2cqpadbdrlh2cf5zmafx79r6z-nix-1.8.drv’ failed with exit code 2
error: build of ‘/scratch/gopinath/nix/store/fl8hcbq2cqpadbdrlh2cf5zmafx79r6z-nix-1.8.drv’ failed

So I disabled doInstallCheck in pkgs/tools/package-management/nix/default.nix. Here are my changes so far

diff --git a/pkgs/tools/misc/coreutils/default.nix b/pkgs/tools/misc/coreutils/default.nix
index 1dc5bfa..635ae2c 100644
--- a/pkgs/tools/misc/coreutils/default.nix
+++ b/pkgs/tools/misc/coreutils/default.nix
@@ -59,7 +59,8 @@ let
     # (http://thread.gmane.org/gmane.comp.gnu.core-utils.bugs/19025),
     # Darwin (http://thread.gmane.org/gmane.comp.gnu.core-utils.bugs/19351),
     # and {Open,Free}BSD.
-    doCheck = stdenv ? glibc;
+    doCheck = false;
+    # stdenv ? glibc;

     # Saw random failures like ‘help2man: can't get '--help' info from
     # man/sha512sum.td/sha512sum’.
diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix
index 2d10511..f272bf7 100644
--- a/pkgs/tools/package-management/nix/default.nix
+++ b/pkgs/tools/package-management/nix/default.nix
@@ -43,7 +43,7 @@ stdenv.mkDerivation rec {

   installFlags = "sysconfdir=$(out)/etc";

-  doInstallCheck = true;
+  doInstallCheck = false;

   crossAttrs = {
     postUnpack =

Next, I ran nix-env -iA nix -f $NIXPKGS ; which resulted in

downloading Nix expressions from ‘http://nixos.org/releases/nixpkgs/nixpkgs-15.05pre59184.e07ea5c/nixexprs.tar.xz’...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
unpacking channels...
installing ‘nix-1.8’
error: opening lock file ‘/nix/var/nix/profiles/default.lock’: No such file or directory

I had passed --localstatedir=$nix_root/var" to the configure. So why is it not using that directory? Any help in proceeding further will be greatly appreciated.

  • 1
    Have you had any luck with this? – steshaw Jun 3 '15 at 11:29
  • 1
    Some what. See here for more information. I do not think it is completely solved yet though. – rahul Jun 6 '15 at 4:17
  • In your case, I think you're better off running NixOS in a VM (perhaps VirtualBox or whatever's available at your university). – steshaw Jun 8 '15 at 11:30
  • 2
    Well the unfortunate thing is that I was trying to get it running on our cluster. The people in our research group have various ad-hoc installation paths, and hence sharing things becomes a nightmare. I was hoping that we could standardize on Nix. Since our primary requirement is being able to access the computing power of the cluster, VMs are out of question for us. – rahul Jun 9 '15 at 3:08
  • 1
    I'm also having trouble installing Nix under an NFS mount. In my case some tests in the coreutils package are failing. I think that an easy workaround could be to build Nix in a VM under the same path, and use the nix-copy-closure to copy the resulting binaries to the shared environment. I will report back if that works for me. – Jesse Hallett Dec 6 '15 at 16:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.