diff options
-rwxr-xr-x | dev-shell | 18 | ||||
-rw-r--r-- | doc/manual/hacking.xml | 4 | ||||
-rw-r--r-- | shell.nix | 33 |
3 files changed, 35 insertions, 20 deletions
diff --git a/dev-shell b/dev-shell deleted file mode 100755 index 5a090ded6080..000000000000 --- a/dev-shell +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash -if [ -e tests/test-tmp ]; then - chmod -R u+w tests/test-tmp - rm -rf tests/test-tmp -fi - -s=$(type -p nix-shell) -exec $s release.nix -A tarball --command " - unset http_proxy - export NIX_REMOTE=$NIX_REMOTE - export NIX_PATH='$NIX_PATH' - export NIX_BUILD_SHELL=$(type -p bash) - export c=\$configureFlags - exec $s release.nix -A build.$(if [ $(uname -s) = Darwin ]; then echo x86_64-darwin; elif [[ $(uname -m) =~ ^i[3456]86$ ]]; then echo i686-linux; else echo x86_64-linux; fi) --exclude tarball --command ' - configureFlags+=\" \$c --prefix=$(pwd)/inst --sysconfdir=$(pwd)/inst/etc\" - return - '" \ - "$@" diff --git a/doc/manual/hacking.xml b/doc/manual/hacking.xml index 11af0998f982..183aed7adff2 100644 --- a/doc/manual/hacking.xml +++ b/doc/manual/hacking.xml @@ -22,7 +22,7 @@ $ nix-build release.nix -A build.x86_64-linux environment variables are set up so that those dependencies can be found: <screen> -$ ./dev-shell +$ nix-shell </screen> To build Nix itself in this shell: <screen> @@ -30,7 +30,7 @@ To build Nix itself in this shell: [nix-shell]$ configurePhase [nix-shell]$ make </screen> -To test it: +To install it in <literal>$(pwd)/nix</literal> and test it: <screen> [nix-shell]$ make install [nix-shell]$ make installcheck diff --git a/shell.nix b/shell.nix new file mode 100644 index 000000000000..272627692a2d --- /dev/null +++ b/shell.nix @@ -0,0 +1,33 @@ +with import <nixpkgs> {}; + +stdenv.mkDerivation { + name = "nix"; + + buildInputs = + [ curl bison flex perl libxml2 libxslt bzip2 xz + pkgconfig sqlite libsodium boehmgc + docbook5 docbook5_xsl + autoconf-archive + (aws-sdk-cpp.override { + apis = ["s3"]; + customMemoryManagement = false; + }) + autoreconfHook + ]; + + configureFlags = + [ "--disable-init-state" + "--enable-gc" + "--with-dbi=${perlPackages.DBI}/${perl.libPrefix}" + "--with-dbd-sqlite=${perlPackages.DBDSQLite}/${perl.libPrefix}" + ]; + + enableParallelBuilding = true; + + installFlags = "sysconfdir=$(out)/etc"; + + shellHook = + '' + configureFlags+=" --prefix=$(pwd)/inst" + ''; +} |