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 {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "styx";
|
2020-06-07 17:45:46 +02:00
|
|
|
version = "0.7.2";
|
2016-10-07 07:08:24 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "styx-static";
|
|
|
|
repo = "styx";
|
2020-06-07 17:45:46 +02:00
|
|
|
rev = "0f0a878156eac416620a177cc030fa9f2f69b1b8";
|
|
|
|
sha256 = "0ig456j1s17w4zhhcmkrskpy6n7061v5f2isa3qhipmn0gwb91af";
|
2016-10-07 07:08:24 +02:00
|
|
|
};
|
|
|
|
|
2019-06-20 04:43:38 +02:00
|
|
|
server = "${caddy}/bin/caddy";
|
2017-02-26 09:35:55 +01:00
|
|
|
linkcheck = "${linkchecker}/bin/linkchecker";
|
2016-10-07 07:08:24 +02:00
|
|
|
|
|
|
|
nativeBuildInputs = [ asciidoctor ];
|
|
|
|
|
2017-08-26 06:46:32 +02:00
|
|
|
outputs = [ "out" "lib" "themes" ];
|
|
|
|
|
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
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir $out
|
2017-08-26 06:46:32 +02:00
|
|
|
install -D -m 777 src/styx.sh $out/bin/styx
|
2016-10-07 07:08:24 +02:00
|
|
|
|
2017-08-26 06:46:32 +02:00
|
|
|
mkdir -p $out/share/styx-src
|
|
|
|
cp -r ./* $out/share/styx-src
|
2016-10-07 07:08:24 +02:00
|
|
|
|
|
|
|
mkdir -p $out/share/doc/styx
|
2017-08-26 06:46:32 +02:00
|
|
|
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/
|
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
|
|
|
|
2017-08-26 06:46:32 +02:00
|
|
|
mkdir -p $out/share/styx/scaffold
|
|
|
|
cp -r src/scaffold $out/share/styx
|
|
|
|
cp -r src/tools $out/share/styx
|
|
|
|
|
2017-01-18 08:28:40 +01:00
|
|
|
mkdir $lib
|
2017-08-26 06:46:32 +02:00
|
|
|
cp -r src/lib/* $lib
|
|
|
|
|
|
|
|
mkdir $themes
|
|
|
|
cp -r themes/* $themes
|
2016-10-07 07:08:24 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2017-08-26 06:46:32 +02:00
|
|
|
description = "Nix based static site generator";
|
|
|
|
maintainers = with maintainers; [ ericsagnes ];
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://styx-static.github.io/styx-site/";
|
|
|
|
downloadPage = "https://github.com/styx-static/styx/";
|
2017-08-26 06:46:32 +02:00
|
|
|
platforms = platforms.all;
|
|
|
|
license = licenses.mit;
|
2016-10-07 07:08:24 +02:00
|
|
|
};
|
|
|
|
}
|