summary refs log tree commit diff
path: root/Documentation/jekyll.nix
blob: 7d6df09a8d12a6d9633150984da39c8199eafad3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# SPDX-FileCopyrightText: 2022 Alyssa Ross <hi@alyssa.is>
# SPDX-License-Identifier: MIT

{ pkgs ? import <nixpkgs> {} }: pkgs.callPackage (

{ lib, bundlerApp, defaultGemConfig, fetchFromGitHub, fetchpatch }:

bundlerApp {
  pname = "jekyll";
  gemdir = ./.;
  exes = [ "jekyll" ];

  gemConfig = defaultGemConfig // {
    # We override Just the Docs to improve AsciiDoc support.
    just-the-docs = attrs:
      let super = defaultGemConfig.just-the-docs or (lib.const {}) attrs; in
      super // {
        # The gem tarball doesn't contain e.g. the SCSS files.
        src = fetchFromGitHub {
          owner = "just-the-docs";
          repo = "just-the-docs";
          rev = assert attrs.version == "0.3.3"; "8bc53f8f45ce6a11be0559c764d39d90f2434ec1";
          sha256 = "sha256-pvct9Ob/TzTZvj2YVZ36FtU2Uo465p3aUc0NCd/0oWo=";
        };

        patches = super.patches or attrs.patches or [] ++ [
          (fetchpatch {
            url = "https://github.com/just-the-docs/just-the-docs/compare/3a834d24ab1bda72f481f1e630f28fb9ba78ce64...e1a76ca3b6c74dfbb1d93f90484a69587e1b3804.patch";
            sha256 = "sha256-W39GTLL8wKMRakk/wa1hjjktbIGWhITWtAdbiMK3PI0=";
          })
        ];

        postPatch = ''
          substituteInPlace just-the-docs.gemspec \
              --replace 'git ls-files -z' 'find * -print0'
        '';
      };
  };
}
) { }