summary refs log blame commit diff
path: root/Documentation/default.nix
blob: fadc1d0dfa9f57b7d5e0cdd1c58702c61b7df53e (plain) (tree)
1
2
3
4
5
6
7
8
9




                                                         
                                             
 

                                   
                          


                                

                                 

    
                                                 
 
                                 

    
                                                           
                                                                       


                                                 
 
# 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; };
}