Skip to content

Instantly share code, notes, and snippets.

@pjones
Created January 4, 2016 17:10
Show Gist options
  • Save pjones/842db5a4057597abe23d to your computer and use it in GitHub Desktop.
Save pjones/842db5a4057597abe23d to your computer and use it in GitHub Desktop.
let
pkgs = import <nixpkgs> {};
stdenv = pkgs.stdenv;
mysql = pkgs.mysql55;
in rec {
cltc-claims = stdenv.mkDerivation rec {
name = "cltc-claims";
version = "0.0";
src = ./.;
buildInputs = with pkgs; [
ruby_2_2_2 bundler git zlib openssl
# See above `let' for MySQL version and vendor.
mysql
];
shellHook = ''
if [ ! -r .bundle/config ]; then
# Watch out, the .bundle/config file might have spurious
# quotes in it due to a bug. Right now you have to clean that
# up by hand.
bundle config --local build.mysql2 \
--with-zlib=${pkgs.zlib} \
--with-mysql-include=${mysql}/include/mysql \
--with-mysql-lib=${mysql}/lib > /dev/null
fi
# Need correct LD_FLAGS for building some C extensions (mysql).
export LD_FLAGS="-L${pkgs.openssl}/lib"
# Now that we have all that, let's install some gems.
bundle install --path vendor/bundle
'';
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment