Created
January 3, 2019 23:58
-
-
Save kalbasit/4526bef69d390d61954adefd124c40c3 to your computer and use it in GitHub Desktop.
This file contains 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
# This allows overriding nixpkgs by passing `--arg pkgs ...` | |
{ pkgs ? import ./devtools/lib/nix/nixpkgs.nix {} | |
, lib ? pkgs.lib | |
}: | |
with pkgs; | |
with lib; | |
let | |
# ruby environment defines an environment suitable for development in Ruby. | |
# To keep gemset.nix in sync with the Gemfile, please run: | |
# k2web vendor | |
rubyEnv = bundlerEnv { | |
ruby = ruby_2_3; | |
gemdir = ./.; | |
groups = [ "default" "production" "development" "test" ]; | |
name = "k2_web-env"; | |
}; | |
in gccStdenv.mkDerivation { | |
name = "keeptruckin-development-environment"; | |
buildInputs = [ | |
# The ruby environment | |
bundix | |
rubyEnv.wrappedRuby | |
rubyEnv.basicEnv | |
rubyEnv.bundler | |
# TODO: this does not work: *** Ruby 'env' attributes are intended for interactive nix-shell sessions, not for building! *** | |
# rubyEnv.env | |
# 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 | |
] ++ optional stdenv.isLinux [ | |
# TODO: make wkhtmltopdf compatible with Mac! | |
wkhtmltopdf | |
]; | |
phases = ["nobuildPhase"]; | |
nobuildPhase = '' | |
echo | |
echo "This derivation is not meant to be built, aborting"; | |
echo | |
exit 1 | |
''; | |
} | |
# (bundlerEnv rec { | |
# ruby = ruby_2_3; | |
# | |
# gemdir = ./.; | |
# | |
# groups = [ "default" "production" "development" "test" ]; | |
# name = "k2_web-env"; | |
# | |
# stdenv = gccStdenv; | |
# | |
# buildInputs = [ | |
# bundix | |
# | |
# # 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 | |
# ] ++ optional stdenv.isLinux [ | |
# # TODO: make wkhtmltopdf compatible with Mac! | |
# wkhtmltopdf | |
# ]; | |
# }).env |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment