Skip to content

Instantly share code, notes, and snippets.

@kalbasit
Created January 4, 2019 19:50
Show Gist options
  • Save kalbasit/efc69eef0d4c9f8f6259b046ae9bf847 to your computer and use it in GitHub Desktop.
Save kalbasit/efc69eef0d4c9f8f6259b046ae9bf847 to your computer and use it in GitHub Desktop.
# This allows overriding nixpkgs by passing `--arg pkgs ...`
{ pkgs ? import ./devtools/lib/nix/nixpkgs.nix {}
, lib ? pkgs.lib
}:
with pkgs;
with lib;
let
ruby = ruby_2_3;
in stdenv.mkDerivation {
name = "keeptruckin-development-environment";
buildInputs = [
# The ruby environment
ruby.devEnv
# Gem dependencies
libxml2 # dependency of the nokogiri Gem
postgresql # dependency of the pg Gem
sqlite # dependency of the sqlite3 Gem
openssl
] ++ optional stdenv.isDarwin [
docker-machine
# Gem dependencies
libiconv # dependency of the nokogiri Gem
] ++ optional stdenv.isLinux [
# TODO: make wkhtmltopdf compatible with Mac!
wkhtmltopdf
];
shellHook = ''
export BUNDLE_BUILD__LIBV8="--with-system-v8"
export BUNDLE_BUILD__SQLITE3-RUBY="--with-sqlite3-include=${getDev sqlite}/include --with-sqlite3-lib=${getDev sqlite}/lib"
'';
phases = ["nobuildPhase"];
nobuildPhase = ''
echo
echo "This derivation is not meant to be built, aborting";
echo
exit 1
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment