2016-12-07 07:01:03 +01:00
|
|
|
{ stdenv, fetchFromGitHub, caddy, asciidoctor
|
2017-02-26 09:35:55 +01:00
|
|
|
, file, lessc, sass, multimarkdown, linkchecker
|
|
|
|
, perlPackages, python27 }:
|
2016-10-07 07:08:24 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "styx-${version}";
|
2017-02-26 09:35:55 +01:00
|
|
|
version = "0.6.0";
|
2016-10-07 07:08:24 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "styx-static";
|
|
|
|
repo = "styx";
|
|
|
|
rev = "v${version}";
|
2017-02-26 09:35:55 +01:00
|
|
|
sha256 = "1dl6zmic8bv17f3ib8by66c2fj7izlnv9dh2cfa2m0ipkxk930vk";
|
2016-10-07 07:08:24 +02:00
|
|
|
};
|
|
|
|
|
2016-12-07 07:01:03 +01:00
|
|
|
setSourceRoot = "cd styx-*/src; export sourceRoot=`pwd`";
|
|
|
|
|
|
|
|
server = "${caddy.bin}/bin/caddy";
|
2017-02-26 09:35:55 +01:00
|
|
|
linkcheck = "${linkchecker}/bin/linkchecker";
|
2016-10-07 07:08:24 +02:00
|
|
|
|
|
|
|
nativeBuildInputs = [ asciidoctor ];
|
|
|
|
|
2016-12-07 07:01:03 +01:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
file
|
|
|
|
lessc
|
|
|
|
sass
|
|
|
|
asciidoctor
|
|
|
|
multimarkdown
|
2017-02-26 09:35:55 +01:00
|
|
|
perlPackages.ImageExifTool
|
|
|
|
(python27.withPackages (ps: [ ps.parsimonious ]))
|
2016-12-07 07:01:03 +01:00
|
|
|
];
|
2016-10-07 07:08:24 +02:00
|
|
|
|
2017-01-18 08:28:40 +01:00
|
|
|
outputs = [ "out" "lib" ];
|
|
|
|
|
2016-10-07 07:08:24 +02:00
|
|
|
installPhase = ''
|
|
|
|
mkdir $out
|
2016-11-03 04:58:53 +01:00
|
|
|
install -D -m 777 styx.sh $out/bin/styx
|
2016-10-07 07:08:24 +02:00
|
|
|
|
|
|
|
mkdir -p $out/share/styx
|
2016-11-03 04:58:53 +01:00
|
|
|
cp -r scaffold $out/share/styx
|
2017-02-26 09:35:55 +01:00
|
|
|
cp -r nix $out/share/styx
|
2016-10-07 07:08:24 +02:00
|
|
|
|
|
|
|
mkdir -p $out/share/doc/styx
|
2017-01-18 08:28:40 +01:00
|
|
|
asciidoctor doc/index.adoc -o $out/share/doc/styx/index.html
|
|
|
|
asciidoctor doc/styx-themes.adoc -o $out/share/doc/styx/styx-themes.html
|
2017-02-26 09:35:55 +01:00
|
|
|
asciidoctor doc/library.adoc -o $out/share/doc/styx/library.html
|
|
|
|
cp -r doc/highlight $out/share/doc/styx/
|
2017-01-18 08:28:40 +01:00
|
|
|
cp -r doc/imgs $out/share/doc/styx/
|
2017-02-26 09:35:55 +01:00
|
|
|
cp -r tools $out/share
|
2016-10-07 07:08:24 +02:00
|
|
|
|
|
|
|
substituteAllInPlace $out/bin/styx
|
|
|
|
substituteAllInPlace $out/share/doc/styx/index.html
|
2017-01-18 08:28:40 +01:00
|
|
|
substituteAllInPlace $out/share/doc/styx/styx-themes.html
|
2017-02-26 09:35:55 +01:00
|
|
|
substituteAllInPlace $out/share/doc/styx/library.html
|
2017-01-18 08:28:40 +01:00
|
|
|
|
|
|
|
mkdir $lib
|
|
|
|
cp -r lib/* $lib
|
2016-10-07 07:08:24 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Nix based static site generator";
|
|
|
|
maintainers = with maintainers; [ ericsagnes ];
|
|
|
|
homepage = https://styx-static.github.io/styx-site/;
|
|
|
|
downloadPage = https://github.com/styx-static/styx/;
|
|
|
|
platforms = platforms.all;
|
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|