2016-10-07 07:08:24 +02:00
|
|
|
{ stdenv, fetchFromGitHub, caddy, asciidoctor }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "styx-${version}";
|
2016-11-03 04:58:53 +01:00
|
|
|
version = "0.3.1";
|
2016-10-07 07:08:24 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "styx-static";
|
|
|
|
repo = "styx";
|
|
|
|
rev = "v${version}";
|
2016-11-03 04:58:53 +01:00
|
|
|
sha256 = "0wyibdyi4ld0kfhng5ldb2rlgjrci014fahxn7nnchlg7dvcc5ni";
|
2016-10-07 07:08:24 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
server = caddy.bin;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ asciidoctor ];
|
|
|
|
|
|
|
|
setSourceRoot = "cd styx-*/src; export sourceRoot=`pwd`";
|
|
|
|
|
|
|
|
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 lib $out/share/styx
|
|
|
|
cp -r scaffold $out/share/styx
|
2016-10-07 07:08:24 +02:00
|
|
|
|
|
|
|
mkdir -p $out/share/doc/styx
|
2016-11-03 04:58:53 +01:00
|
|
|
asciidoctor doc/manual.adoc -o $out/share/doc/styx/index.html
|
2016-10-07 07:08:24 +02:00
|
|
|
|
|
|
|
substituteAllInPlace $out/bin/styx
|
|
|
|
substituteAllInPlace $out/share/doc/styx/index.html
|
|
|
|
'';
|
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|