This repository contains instructions and a nix
setup needed for building
LaTeX
documents in a reproducible manner.
In the directory where the LaTeX document can be found run:
niv init
After that copy default.nix
and Makefile
, and adapt it to your liking. You
will probably want to change DOCNAME
in the Makefile
, and name
and
description
in default.nix
.
To build the latex document run:
nix-shell --run make
The document can be built using nix-build
. After running this command look
inside the result
directory.
For a continuous compilation of the LaTeX
file run:
nix-shell --run "make watch"
Most likely you will need other LaTeX
packages. These can be added in the
default.nix
file.
Note that when adding a new package, it might be necessary to run:
nix-shell --run "make clean"
The first step towards reproducible builds is specifying which package versions
we need. This process is greatly simplified by
niv
. Make sure you install it using nix to
manage the nixpkgs
versions as well as other sources you need to pin.
If you install and configure lorri
then it
is not necessary to use the nix-shell
command, and one can use make
directly. See the project documentation for details on how to use it.