@@ -0,0 +1,43 @@
1+{ stdenv, fetchFromGitHub, caddy, asciidoctor }:
2+
3+stdenv.mkDerivation rec {
4+ name = "styx-${version}";
5+ version = "0.1.0";
6+
7+ src = fetchFromGitHub {
8+ owner = "styx-static";
9+ repo = "styx";
10+ rev = "v${version}";
11+ sha256 = "0lz6mfawschfjg4mvfsqz9dv884x2lcg787zjdlnhdi5yqmjx29r";
12+ };
13+
14+ server = caddy.bin;
15+
16+ nativeBuildInputs = [ asciidoctor ];
17+
18+ setSourceRoot = "cd styx-*/src; export sourceRoot=`pwd`";
19+
20+ installPhase = ''
21+ mkdir $out
22+ install -D -m 777 $sourceRoot/styx.sh $out/bin/styx
23+
24+ mkdir -p $out/share/styx
25+ cp -r $sourceRoot/sample $out/share/styx
26+
27+ mkdir -p $out/share/doc/styx
28+ asciidoctor $sourceRoot/doc/manual.doc -o $out/share/doc/styx/index.html
29+
30+ substituteAllInPlace $out/bin/styx
31+ substituteAllInPlace $out/share/styx/sample/templates/feed.nix
32+ substituteAllInPlace $out/share/doc/styx/index.html
33+ '';
34+
35+ meta = with stdenv.lib; {
36+ description = "Nix based static site generator";
37+ maintainers = with maintainers; [ ericsagnes ];
38+ homepage = https://styx-static.github.io/styx-site/;
39+ downloadPage = https://github.com/styx-static/styx/;
40+ platforms = platforms.all;
41+ license = licenses.mit;
42+ };
43+}