Created
May 31, 2018 09:02
-
-
Save manveru/1f7dfa8957f761b5d0a66cf1820dc1cb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ buildStatic ? false }: | |
with import <nixpkgs> {}; | |
let | |
crystalLib = (import ./nix/crystal2nix.nix { | |
inherit stdenv lib remarshal runCommand; | |
}).crystalLib; | |
staticStdenv = (makeStaticLibraries stdenv); | |
in mkShell { | |
buildInputs = [ | |
postgresql100 | |
shards | |
crystal | |
libxml2 | |
libyaml | |
openssl | |
pkgconfig | |
gmp | |
] ++ lib.optionals buildStatic [ | |
glibc.static | |
zlib.static | |
(openssl.override { stdenv = stdenv // { | |
mkDerivation = args: stdenv.mkDerivation (args // { | |
dontDisableStatic = true; | |
configureFlags = [ | |
"no-shared" | |
"--libdir=lib" | |
"--openssldir=etc/ssl" | |
]; | |
}); | |
}; }) | |
(gmp.override { stdenv = staticStdenv; }) | |
(libyaml.override { stdenv = staticStdenv; }) | |
(libevent.override { stdenv = staticStdenv; }) | |
(pcre.override { stdenv = staticStdenv; }) | |
(boehmgc.override { stdenv = staticStdenv // { isLinux = false; }; }) | |
]; | |
shellHook = '' | |
rm -rf lib | |
ln -s ${crystalLib} lib | |
export PGDATA=$PWD/pg | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment