Skip to content

Instantly share code, notes, and snippets.

@manveru
Created May 31, 2018 09:02
Show Gist options
  • Save manveru/1f7dfa8957f761b5d0a66cf1820dc1cb to your computer and use it in GitHub Desktop.
Save manveru/1f7dfa8957f761b5d0a66cf1820dc1cb to your computer and use it in GitHub Desktop.
{ 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