49 lines
1.3 KiB
Nix
49 lines
1.3 KiB
Nix
{
|
|
description = "A very basic presentation with Beamer";
|
|
|
|
outputs = { self, dragnpkgs } @ inputs: dragnpkgs.lib.mkFlake {
|
|
# Define a texlive environment to use
|
|
packages.texlive-custom = { texlive }: texlive.combine {
|
|
inherit (texlive)
|
|
scheme-medium
|
|
appendixnumberbeamer
|
|
fontawesome5
|
|
moloch;
|
|
};
|
|
|
|
# Package definition for building the PDF
|
|
packages.default = { system, stdenvNoCC }: stdenvNoCC.mkDerivation rec {
|
|
pname = "my-beamer-presentation";
|
|
|
|
name = "${pname}.pdf";
|
|
|
|
nativeBuildInputs = [
|
|
self.packages.${system}.texlive-custom
|
|
];
|
|
|
|
src = self;
|
|
|
|
buildPhase = ''
|
|
latexmk -pdf ${pname}.tex
|
|
'';
|
|
|
|
installPhase = ''
|
|
cp ${pname}.pdf $out
|
|
'';
|
|
};
|
|
|
|
# Runnable package (ie `nix run`) to start the presentation
|
|
apps.default = { lib, system, writeShellScript, pympress }: {
|
|
type = "app";
|
|
program = "${writeShellScript "start-presentation" ''
|
|
exec ${lib.getExe pympress} ${self.packages.${system}.default}
|
|
''}";
|
|
};
|
|
|
|
# Devshell definition to expose the texlive environment to eg nvim
|
|
devShells.default = { mkShell, system }: mkShell {
|
|
packages = [ self.packages.${system}.texlive-custom ];
|
|
};
|
|
};
|
|
}
|