2019-04-11 21:05:46 +00:00
|
|
|
{ lib, bundlerApp, ruby
|
2019-06-28 13:33:06 +00:00
|
|
|
, writeShellScriptBin, makeWrapper
|
2018-02-19 17:32:35 +00:00
|
|
|
, withOptionalDependencies ? false
|
|
|
|
}:
|
2015-05-16 17:26:07 +00:00
|
|
|
|
2019-06-28 13:33:06 +00:00
|
|
|
let
|
|
|
|
rubyWrapper = writeShellScriptBin "ruby" ''
|
|
|
|
if [[ "$#" -eq 2 ]]; then
|
|
|
|
if [[ "''${1##*/}" == "bundle" && "$2" == "install" ]]; then
|
|
|
|
# See https://github.com/NixOS/nixpkgs/issues/58126 for more details.
|
|
|
|
echo 'Skipping "bundle install" as it fails due to the Nix wrapper.'
|
|
|
|
echo 'Please enter the new directory and run the following commands to serve the page:'
|
|
|
|
echo 'nix-shell -p bundler --run "bundle install --gemfile=Gemfile --path vendor/cache"'
|
|
|
|
echo 'nix-shell -p bundler --run "bundle exec jekyll serve"'
|
|
|
|
exit 0
|
|
|
|
# The following nearly works:
|
|
|
|
unset BUNDLE_FROZEN
|
|
|
|
exec ${ruby}/bin/ruby "$@" --gemfile=Gemfile --path=vendor/cache
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
# Else: Don't modify the arguments:
|
|
|
|
exec ${ruby}/bin/ruby "$@"
|
|
|
|
'';
|
|
|
|
in bundlerApp rec {
|
2018-02-19 16:22:25 +00:00
|
|
|
pname = "jekyll";
|
2019-04-11 21:05:46 +00:00
|
|
|
exes = [ "jekyll" ];
|
2015-05-16 17:26:07 +00:00
|
|
|
|
2017-03-04 01:08:53 +00:00
|
|
|
inherit ruby;
|
2018-02-19 17:32:35 +00:00
|
|
|
gemdir = if withOptionalDependencies
|
|
|
|
then ./full
|
|
|
|
else ./basic;
|
2015-05-16 17:26:07 +00:00
|
|
|
|
2019-06-28 13:33:06 +00:00
|
|
|
buildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
wrapProgram $out/bin/jekyll --prefix PATH : ${rubyWrapper}/bin
|
|
|
|
'';
|
|
|
|
|
2015-05-16 17:26:07 +00:00
|
|
|
meta = with lib; {
|
2018-02-19 17:32:35 +00:00
|
|
|
description = "A blog-aware, static site generator, written in Ruby";
|
|
|
|
longDescription = ''
|
|
|
|
Jekyll is a simple, blog-aware, static site generator, written in Ruby.
|
|
|
|
Think of it like a file-based CMS, without all the complexity. Jekyll
|
|
|
|
takes your content, renders Markdown and Liquid templates, and spits out a
|
|
|
|
complete, static website ready to be served by Apache, Nginx or another
|
|
|
|
web server. Jekyll is the engine behind GitHub Pages, which you can use to
|
|
|
|
host sites right from your GitHub repositories.
|
|
|
|
'';
|
2018-02-19 16:22:25 +00:00
|
|
|
homepage = https://jekyllrb.com/;
|
2015-05-28 17:20:29 +00:00
|
|
|
license = licenses.mit;
|
2018-02-19 16:22:25 +00:00
|
|
|
maintainers = with maintainers; [ primeos pesterhazy ];
|
2015-05-16 17:26:07 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|