aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2016-11-28 16:13:23 +0100
committerEelco Dolstra <edolstra@gmail.com>2016-12-06 17:17:29 +0100
commit09191caea8a0bf59daef553ca251a8d1d7e1d507 (patch)
tree87cb608cb13d4fdb53ea262988724685fd338501
parentd1da6967b8891763ce04d668027cf300c9bbf0b2 (diff)
Add shell.nix
-rwxr-xr-xdev-shell18
-rw-r--r--doc/manual/hacking.xml4
-rw-r--r--shell.nix33
3 files changed, 35 insertions, 20 deletions
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:
<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 000000000..272627692
--- /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"
+ '';
+}