~aasg/haunted-blog

ref: eeed5686b294c51d3e35fdd982f51da1c91c47ba haunted-blog/default.nix -rw-r--r-- 1.2 KiB
eeed5686 — Aluísio Augusto Silva Gonçalves Publish SPDX licensing metadata 8 months ago
                                                                                
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
41
42
43
44
45
46
47
48
49
50
51
# SPDX-FileCopyrightText: 2020 Aluísio Augusto Silva Gonçalves <https://aasg.name>
# SPDX-License-Identifier: MIT

{ pkgs ? (import ./channels.nix).nixpkgs { }
, aasg-pkgs ? ((import ./channels.nix).aasg { inherit pkgs; })
, src ?
  builtins.filterSource
    (
      pkgs.nix-gitignore.gitignoreFilter ''
        /*
        # For building
        !/haunt.scm
        !/assets/
        !/pages/
        !/posts/
        !/scm/
        !/static/
        # For licensing information
        !/*.nix
        !/LICENSES/
        !/.reuse/
      '' ./.
    ) ./.
}:
let
  drv = pkgs.stdenvNoCC.mkDerivation {
    name = "aasg-blog";
    inherit src;

    LANG = "C.UTF-8";
    GUILE_LOAD_PATH = "${aasg-pkgs.guile-json}/share/guile/site";
    GUILE_COMPILED_LOAD_PATH = "${aasg-pkgs.guile-json}/share/guile/site/site-ccache";

    nativeBuildInputs = [ aasg-pkgs.haunt pkgs.pandoc pkgs.reuse ];
    buildPhase = ''
      cd $src
      export HAUNT_DESTDIR=$out
      haunt build
      reuse spdx -o $out/files/reuse.spdx
    '';

    doCheck = true;
    checkPhase = ''
      reuse --root=${src} lint
    '';

    dontInstall = true;
  };
  ciDeps = with pkgs; [ ipfs ipfs-cluster libarchive ];
in
pkgs.recurseIntoAttrs (drv // { inherit ciDeps; })