Skip to content

Commit

Permalink
Updated README.md as per issue hmemcpy#288 (hmemcpy#289)
Browse files Browse the repository at this point in the history
* Updated README.md as per issue hmemcpy#288

* Added steps to install nixFlakes explicitly, ref hmemcpy#289
  • Loading branch information
mlliarm authored Apr 4, 2022
1 parent d826d28 commit 54333b2
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 .#<edition>` 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.

Expand Down

0 comments on commit 54333b2

Please sign in to comment.