Nix packaging
Scryer-prolog has good support for the declarative and reproducible buildsystem Nix :)
The repo contains a flake.nix and it is available in nixpkgs. Therefore using scryer with nix is very easy:
nix run nixpkgs#scryer-prologPackage your own prolog code
Let's have a look at an example…
I packaged the static site generator DocLog, that builds documentation from source code in Prolog.
Btw, this tutorial is written with DocLog ;)
DocLog has 2 external dependencies:
teruel is a Tera and Jinja inspired template engine for prolog
Without nix, the default way of setting up DocLog is using this Makefile.
The nix flake contains:
source packages for the dependencies
teruelanddjota(usingfetchFromGitHub)the
doclogpackage created withmkDerivationthe apps
doclog,doclog_watchand the aliaswatchpoint to the relevant binaries and allow trivial usage withnix run
nix run github:aarroyoc/doclog# . www
#-> creates documentation from docstrings in prolog files from `.` and places them into the `www` directory.
nix run github:aarroyoc/doclog#watch . www
#-> this wrapper uses inotifywait to rebuild everytime the source changed