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

72 lines
1.9 KiB
Nix
Raw Normal View History

2016-12-07 06:01:03 +00:00
{ stdenv, fetchFromGitHub, caddy, asciidoctor
2017-02-26 08:35:55 +00:00
, file, lessc, sass, multimarkdown, linkchecker
, perlPackages, python27 }:
2016-10-07 05:08:24 +00:00
stdenv.mkDerivation rec {
name = "styx-${version}";
2018-01-26 13:01:59 +00:00
version = "0.7.1";
2016-10-07 05:08:24 +00:00
src = fetchFromGitHub {
owner = "styx-static";
repo = "styx";
rev = "v${version}";
2018-01-26 13:01:59 +00:00
sha256 = "01lklz7l9klqmmsncikwjnk3glzyz15c30118s82yd1chwpwhpfl";
2016-10-07 05:08:24 +00:00
};
2019-06-20 02:43:38 +00:00
server = "${caddy}/bin/caddy";
2017-02-26 08:35:55 +00:00
linkcheck = "${linkchecker}/bin/linkchecker";
2016-10-07 05:08:24 +00:00
nativeBuildInputs = [ asciidoctor ];
2017-08-26 04:46:32 +00:00
outputs = [ "out" "lib" "themes" ];
2016-12-07 06:01:03 +00:00
propagatedBuildInputs = [
file
lessc
sass
asciidoctor
multimarkdown
2017-02-26 08:35:55 +00:00
perlPackages.ImageExifTool
(python27.withPackages (ps: [ ps.parsimonious ]))
2016-12-07 06:01:03 +00:00
];
2016-10-07 05:08:24 +00:00
installPhase = ''
mkdir $out
2017-08-26 04:46:32 +00:00
install -D -m 777 src/styx.sh $out/bin/styx
2016-10-07 05:08:24 +00:00
2017-08-26 04:46:32 +00:00
mkdir -p $out/share/styx-src
cp -r ./* $out/share/styx-src
2016-10-07 05:08:24 +00:00
mkdir -p $out/share/doc/styx
2017-08-26 04:46:32 +00: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 05:08:24 +00:00
substituteAllInPlace $out/bin/styx
substituteAllInPlace $out/share/doc/styx/index.html
2017-01-18 07:28:40 +00:00
substituteAllInPlace $out/share/doc/styx/styx-themes.html
2017-02-26 08:35:55 +00:00
substituteAllInPlace $out/share/doc/styx/library.html
2017-01-18 07:28:40 +00:00
2017-08-26 04:46:32 +00:00
mkdir -p $out/share/styx/scaffold
cp -r src/scaffold $out/share/styx
cp -r src/tools $out/share/styx
2017-01-18 07:28:40 +00:00
mkdir $lib
2017-08-26 04:46:32 +00:00
cp -r src/lib/* $lib
mkdir $themes
cp -r themes/* $themes
2016-10-07 05:08:24 +00:00
'';
meta = with stdenv.lib; {
2017-08-26 04:46:32 +00:00
description = "Nix based static site generator";
maintainers = with maintainers; [ ericsagnes ];
homepage = https://styx-static.github.io/styx-site/;
2016-10-07 05:08:24 +00:00
downloadPage = https://github.com/styx-static/styx/;
2017-08-26 04:46:32 +00:00
platforms = platforms.all;
license = licenses.mit;
2016-10-07 05:08:24 +00:00
};
}