summary refs log tree commit diff
path: root/Documentation/default.nix
blob: 564a4769a836afa29d9f56074acfdb56b702a93b (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
# SPDX-FileCopyrightText: 2022 Alyssa Ross <hi@alyssa.is>
# SPDX-FileCopyrightText: 2022 Unikie
# SPDX-License-Identifier: MIT

{ config ? import ../nix/eval-config.nix {} }: config.pkgs.callPackage (

{ lib, stdenvNoCC, jekyll, drawio-headless }:

stdenvNoCC.mkDerivation {
  name = "spectrum-docs";

  src = with lib; cleanSourceWith {
    src = cleanSource ./.;
    filter = name: _type:
      builtins.baseNameOf name != ".jekyll-cache" &&
      builtins.baseNameOf name != "_site" &&
      !(hasSuffix ".nix" name) &&
      !(hasSuffix ".svg" name);
  };

  buildPhase = ''
    runHook preBuild
    scripts/build.sh -d $out
    runHook postBuild
  '';

  dontInstall = true;

  nativeBuildInputs = [ jekyll drawio-headless ];

  passthru = { inherit jekyll; };
}
) {
  jekyll = import ./jekyll.nix { inherit config; };
}