This repository has been archived by the owner on Aug 13, 2022. It is now read-only.
forked from styx-static/styx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
derivation.nix
70 lines (56 loc) · 1.84 KB
/
derivation.nix
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{ lib, stdenv, asciidoctor
, caddy
, linkchecker
, callPackage
, pkgs }:
stdenv.mkDerivation rec {
preferLocalBuild = true;
allowSubstitutes = false;
name = "styx-${version}";
version = builtins.unsafeDiscardStringContext (lib.fileContents ./VERSION);
src = lib.cleanSource ./.;
server = lib.getExe caddy;
linkcheck = lib.getExe linkchecker;
nixpkgs = pkgs.path;
nativeBuildInputs = [ asciidoctor ];
# outputs = [ "out" ];
installPhase = ''
mkdir $out
install -D -m 777 src/styx.sh $out/bin/styx
cp src/default.nix $out/default.nix
cp src/styx-config.nix $out/styx-config.nix
mkdir -p $out/share/doc/styx
asciidoctor src/doc/index.adoc -o $out/share/doc/styx/index.html
asciidoctor src/doc/styx-themes.adoc -o $out/share/doc/styx/styx-themes.html
asciidoctor src/doc/library.adoc -o $out/share/doc/styx/library.html
cp -r src/doc/highlight $out/share/doc/styx/
cp -r src/doc/imgs $out/share/doc/styx/
substituteAllInPlace $out/bin/styx
substituteAllInPlace $out/share/doc/styx/index.html
substituteAllInPlace $out/share/doc/styx/styx-themes.html
substituteAllInPlace $out/share/doc/styx/library.html
mkdir -p $out/share/styx/scaffold
cp flake.lock $out/share/styx/flake.lock
cp -r src/scaffold $out/share/styx
cp -r src/tools $out/share/styx
cp -r src/nix $out/share/styx
mkdir -p $out/lib
cp -r src/lib/* $out/lib
'';
passthru = {
themes = (import ./themes {
inherit pkgs;
styx = callPackage ./derivation.nix;
}) // {
# old theme compatibility
outPath = ./compat/themes.nix;
};
# old theme compatibility
lib = ./compat/lib.nix;
};
meta = with lib; {
description = "Nix based static site generator";
maintainers = with maintainers; [ ericsagnes ];
platforms = platforms.all;
};
}