nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 bundlerApp,
4 makeWrapper,
5 ruby,
6 writeShellScriptBin,
7 withOptionalDependencies ? false,
8}:
9
10let
11 rubyWrapper = writeShellScriptBin "ruby" ''
12 if [[ "$#" -eq 2 ]]; then
13 if [[ "''${1##*/}" == "bundle" && "$2" == "install" ]]; then
14 # See https://github.com/NixOS/nixpkgs/issues/58126 for more details.
15 echo 'Skipping "bundle install" as it fails due to the Nix wrapper.'
16 echo 'Please enter the new directory and run the following commands to serve the page:'
17 echo 'nix-shell -p bundler --run "bundle install --gemfile=Gemfile --path vendor/cache"'
18 echo 'nix-shell -p bundler --run "bundle exec jekyll serve"'
19 exit 0
20 # The following nearly works:
21 unset BUNDLE_FROZEN
22 exec ${ruby}/bin/ruby "$@" --gemfile=Gemfile --path=vendor/cache
23 fi
24 fi
25 # Else: Don't modify the arguments:
26 exec ${ruby}/bin/ruby "$@"
27 '';
28in
29bundlerApp {
30 pname = "jekyll";
31 exes = [ "jekyll" ];
32
33 inherit ruby;
34 gemdir = if withOptionalDependencies then ./full else ./basic;
35
36 nativeBuildInputs = [ makeWrapper ];
37
38 postBuild = ''
39 wrapProgram $out/bin/jekyll --prefix PATH : ${rubyWrapper}/bin
40 '';
41
42 passthru.updateScript = ./update.sh;
43
44 meta = with lib; {
45 description = "Blog-aware, static site generator, written in Ruby";
46 longDescription = ''
47 Jekyll is a simple, blog-aware, static site generator, written in Ruby.
48 Think of it like a file-based CMS, without all the complexity. Jekyll
49 takes your content, renders Markdown and Liquid templates, and spits out a
50 complete, static website ready to be served by Apache, Nginx or another
51 web server. Jekyll is the engine behind GitHub Pages, which you can use to
52 host sites right from your GitHub repositories.
53 '';
54 homepage = "https://jekyllrb.com/";
55 changelog = "https://jekyllrb.com/news/releases/";
56 license = licenses.mit;
57 maintainers = [ maintainers.anthonyroussel ];
58 platforms = platforms.unix;
59 mainProgram = "jekyll";
60 };
61}