Add shell.nix

This commit is contained in:
Eelco Dolstra 2016-11-28 16:13:23 +01:00
parent d1da6967b8
commit 09191caea8
No known key found for this signature in database
GPG Key ID: 8170B4726D7198DE
3 changed files with 35 additions and 20 deletions

View File

@ -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
'" \
"$@"

View File

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

33
shell.nix Normal file
View File

@ -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"
'';
}