TikZ reproduction of the linked sketch.
The result looks like
Use Nix to set up a reproducible environment for editing this figure. Note that the first time these commands are run, there may be a significant delay if the dependencies (e.g. TeXLive) need to be downloaded and built.
nix-build
The output PDF is created in ./result
.
nix-shell
This drops you into a shell environment with the necessary dependencies. E.g. you can then run
pdflatex figure.tex
to rebuild the figure after editing the TeX code.
-
default.nix
is the entry point for thenix-build
andnix-shell
commands. It imports the environmentnixpkgs
version and callspackage.nix
. Note: this method is not fully reproducible because the environment may define a different revision ofnixpkgs
than we used in the original build. For full reproducibility, userelease.nix
instead (this pins the version ofnixpkgs
). -
package.nix
takes as input somenixpkgs
repository and contains the actual build instructions. In this case, we can use thetexFunctions.runLaTeX
helper, so the only work to be done is to specify the additional packages we depend on. -
release.nix
is the entry point for reproducible builds. That is, it serves the same purpose asdefault.nix
, but pins the version ofnixpkgs
that is used to build the environment (the pinned version is specified innixpkgs.json
). This can be used withnix-build
andnix-shell
by passing it as an arugment, e.g.nix-build release.nix
. -
nixpkgs.json
specifies the revision of thenixpkgs
repository used for the reproducible build. It is imported byrelease.nix