48 lines
1.1 KiB
Nix
48 lines
1.1 KiB
Nix
{
|
|
description = "This is a test if lualatex works";
|
|
|
|
inputs = {
|
|
nixpkgs = {
|
|
type = "indirect";
|
|
id = "nixpkgs";
|
|
};
|
|
};
|
|
|
|
outputs = {self, nixpkgs} :
|
|
let
|
|
|
|
# System types to support.
|
|
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
|
|
|
|
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
|
|
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
|
|
|
# Nixpkgs instantiated for supported system types.
|
|
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
|
|
|
|
|
|
in {
|
|
packages = forAllSystems (system:
|
|
let
|
|
pkgs = nixpkgsFor.${system};
|
|
latexdeps = {inherit (pkgs.texlive) scheme-full;};
|
|
latex = pkgs.texlive.combine latexdeps;
|
|
in {
|
|
default = pkgs.stdenvNoCC.mkDerivation {
|
|
name = "output.pdf";
|
|
buildInputs = [latex];
|
|
src = self;
|
|
buildPhase = ''
|
|
lualatex src/Main.tex
|
|
'';
|
|
installPhase = ''
|
|
mkdir -p $out
|
|
cp Main.pdf $out/output.pdf
|
|
'';
|
|
};
|
|
}
|
|
);
|
|
};
|
|
}
|
|
|
|
|