nixpkgs/pkgs/applications/misc/styx/default.nix

72 lines
1.9 KiB
Nix
Raw Normal View History

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}";
2018-01-26 14:01:59 +01:00
version = "0.7.1";
2016-10-07 07:08:24 +02:00
src = fetchFromGitHub {
owner = "styx-static";
repo = "styx";
rev = "v${version}";
2018-01-26 14:01:59 +01:00
sha256 = "01lklz7l9klqmmsncikwjnk3glzyz15c30118s82yd1chwpwhpfl";
2016-10-07 07:08:24 +02:00
};
2016-12-07 07:01:03 +01:00
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 ];
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 ];
homepage = https://styx-static.github.io/styx-site/;
2016-10-07 07:08:24 +02:00
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
};
}