hydra-config/slidenado.nix

35 lines
926 B
Nix
Raw Permalink Normal View History

2019-09-12 17:14:55 +02:00
{pkgs ? import <nixpkgs> {},
}:
with pkgs;
let
presentations =
map (match: builtins.elemAt match 0)
(builtins.filter (match: match != null)
(map (builtins.match "(.+)\.tex")
(builtins.attrNames
(lib.filterAttrs (name: type: type == "regular")
(builtins.readDir <slidenado/presentations>)
))));
presentation = name:
stdenv.mkDerivation {
name = "slidenado-${name}";
2019-09-12 17:35:35 +02:00
src = <slidenado>;
nativeBuildInputs = [ texlive.combined.scheme-full perl ];
2019-09-12 18:24:49 +02:00
HOME = "/tmp";
2019-09-12 17:36:46 +02:00
makeFlags = [ "presentations/${name}.pdf" ];
2019-09-12 22:20:52 +02:00
installPhase = ''
2019-09-12 17:14:55 +02:00
mkdir -p $out/nix-support
2019-09-12 17:36:46 +02:00
cp presentations/${name}.pdf $out/
2019-09-12 17:14:55 +02:00
echo doc-pdf slides $out/${name}.pdf >> $out/nix-support/hydra-build-products
'';
};
in
builtins.listToAttrs
(map (name: {
inherit name;
value = lib.hydraJob (presentation name);
}) presentations)