From 54333b243ac78333237c499bf2a36791679d9680 Mon Sep 17 00:00:00 2001 From: "Mi. Lia" Date: Mon, 4 Apr 2022 17:32:32 +0200 Subject: [PATCH] Updated README.md as per issue #288 (#289) * Updated README.md as per issue #288 * Added steps to install nixFlakes explicitly, ref #289 --- README.md | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 19581796..a2d24250 100644 --- a/README.md +++ b/README.md @@ -22,23 +22,25 @@ This is an *unofficial* PDF version of "Category Theory for Programmers" by Bart Building -------- -The best way to build the book is using the [Nix](https://nixos.org/nix/) package manager. After installing Nix, type `nix-shell` in the root directory of the project. This will download all the needed dependencies and tools to build the book (TeXLive, required fonts and packages, Pygments theme for syntax highligting, etc.) - -When the download is complete, and you're prompted with a shell, use the instructions below to build the book. - -The `src` directory contains the LaTeX sources. To recompile the book, go there and enter: +The best way to build the book is using the [Nix](https://nixos.org/nix/) package manager. After [installing Nix](https://nixos.org/download.html), if you're using a non-NixOS operating system, you need to install `nixFlakes` in your environment following the steps below ([source](https://nixos.wiki/wiki/Flakes#Non-NixOS)): ```bash -$ make +$ nix-env -iA nixpkgs.nixFlakes ``` -To build the Scala edition, type: +Edit either `~/.config/nix/nix.conf` or `/etc/nix/nix.conf` and add: -```bash -$ make scala ``` +experimental-features = nix-command flakes +``` + +This is needed to expose the Nix 2.0 CLI and flakes support that are hidden behind feature-flags. + +Also, if the Nix installation is in multi-user mode, don’t forget to restart the nix-daemon. + +Afterwards, type `nix flake show` in the root directory of the project to see all the available versions of this book. Then type `nix build .#` to build the edition you want (Haskell, Scala, OCaml, Reason and their printed versions). For example, to build the Scala edition you'll have to type `nix build .#ctfp-scala`. -Upon successful compilation, the files will be placed in the `out` directory next to `src`. +Upon successful compilation, the PDF file will be placed in the `result` directory inside the root directory `milewski-ctfp-pdf` of the repository. The file `preamble.tex` contains all the configuration and style declarations.