4.flake-parts/site/flake-module.nix
2022-05-25 10:05:25 +02:00

22 lines
590 B
Nix

{ ... }: {
perSystem = system: { config, self', inputs', pkgs, lib, ... }: {
packages.websitePackage = pkgs.stdenvNoCC.mkDerivation {
name = "site";
nativeBuildInputs = [ pkgs.pandoc ];
src = lib.cleanSourceWith {
filter = path: type:
path == ./.
|| baseNameOf path == "index.html";
src = ./.;
};
buildPhase = ''
pandoc --from docbook --to html5 \
${config.packages.optionsDocBook} >options.html
'';
installPhase = ''
mkdir -p $out
cp *.html $out/
'';
};
};
}