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

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

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

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

  nativeBuildInputs = [ jekyll drawio-headless ];

  passthru = { inherit jekyll; };
}
  ''
  jekyll build --disable-disk-cache -b /doc -s $src -d $out
  drawio --recursive $out/diagrams/ --export -f svg $out/assets/images/
''
) {
  jekyll = import ./jekyll.nix { inherit pkgs; };
}