diff --git a/dev-shell b/dev-shell
deleted file mode 100755
index 5a090ded6..000000000
--- 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 11af0998f..183aed7ad 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:
-$ ./dev-shell
+$ nix-shell
To build Nix itself in this shell:
@@ -30,7 +30,7 @@ To build Nix itself in this shell:
[nix-shell]$ configurePhase
[nix-shell]$ make
-To test it:
+To install it in $(pwd)/nix and test it:
[nix-shell]$ make install
[nix-shell]$ make installcheck
diff --git a/shell.nix b/shell.nix
new file mode 100644
index 000000000..272627692
--- /dev/null
+++ b/shell.nix
@@ -0,0 +1,33 @@
+with import {};
+
+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"
+ '';
+}