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

72 lines
2.0 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub, caddy, asciidoctor
2017-02-26 08:35:55 +00:00
, file, lessc, sass, multimarkdown, linkchecker
, perlPackages, python27 }:
2016-10-07 06:08:24 +01:00
stdenv.mkDerivation rec {
pname = "styx";
2020-06-07 16:45:46 +01:00
version = "0.7.2";
2016-10-07 06:08:24 +01:00
src = fetchFromGitHub {
owner = "styx-static";
repo = "styx";
2020-06-07 16:45:46 +01:00
rev = "0f0a878156eac416620a177cc030fa9f2f69b1b8";
sha256 = "0ig456j1s17w4zhhcmkrskpy6n7061v5f2isa3qhipmn0gwb91af";
2016-10-07 06:08:24 +01:00
};
2019-06-20 03:43:38 +01:00
server = "${caddy}/bin/caddy";
2017-02-26 08:35:55 +00:00
linkcheck = "${linkchecker}/bin/linkchecker";
2016-10-07 06:08:24 +01:00
nativeBuildInputs = [ asciidoctor ];
2017-08-26 05:46:32 +01: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 06:08:24 +01:00
installPhase = ''
mkdir $out
2017-08-26 05:46:32 +01:00
install -D -m 777 src/styx.sh $out/bin/styx
2016-10-07 06:08:24 +01:00
2017-08-26 05:46:32 +01:00
mkdir -p $out/share/styx-src
cp -r ./* $out/share/styx-src
2016-10-07 06:08:24 +01:00
mkdir -p $out/share/doc/styx
2017-08-26 05:46:32 +01: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 06:08:24 +01: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 05:46:32 +01: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 05:46:32 +01:00
cp -r src/lib/* $lib
mkdir $themes
cp -r themes/* $themes
2016-10-07 06:08:24 +01:00
'';
meta = with lib; {
2017-08-26 05:46:32 +01:00
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/";
2017-08-26 05:46:32 +01:00
platforms = platforms.all;
license = licenses.mit;
2016-10-07 06:08:24 +01:00
};
}