update readme

This commit is contained in:
Youwen Wu 2024-10-20 02:38:31 -07:00
parent 9ab363b0f7
commit 9939d5ca27
Signed by: youwen5
GPG key ID: 865658ED1FE61EC3

View file

@ -23,15 +23,32 @@ interface to the familiar `nixpkgs` package repository. Instead of building
programs, however, it builds documents. Review [the flake](./2024/flake.nix) programs, however, it builds documents. Review [the flake](./2024/flake.nix)
for more information. for more information.
You can test this local compilation yourself very easily! Simply run: Since the flake in [2024] provides a package set, you can use the `nix search`
command on it to discover documents just like `nixpkgs`. Try:
```sh
nix search git+https://code.youwen.dev/youwen5/alexandria?dir=2024 phil-1
```
You can compile any document in this repository yourself very easily! Simply
run:
```sh ```sh
nix build 'git+https://code.youwen.dev/youwen5/alexandria?dir=2024#digression-linear-algebra' nix build 'git+https://code.youwen.dev/youwen5/alexandria?dir=2024#digression-linear-algebra'
``` ```
This will create a `result` that points to the compiled PDF in the Nix store. The builds are managed by the amazing
Currently, the file is not marked as a PDF with a `.pdf` file extension, but [typix](https://github.com/loqusion/typix) project. It helps provide a
one should be able to easily `cp` the file from the Nix store into another hermetically sealed build environment, which means that all _dependencies_ of
the documents are specified, including fonts, commonly forgotten due to being
installed systemwide. Also, the build process clones down a copy of the entire
[Typst package repository](https://github.com/typst/packages), version locked
in [flake.lock](./2024/flake.lock). This means that packages are also
guaranteed to be reproducible and available.
Compilation creates a `result` that points to the compiled PDF in the Nix
store. Currently, the file is not marked as a PDF with a `.pdf` file extension,
but one should be able to easily `cp` the file from the Nix store into another
directory with a proper file name. Work is ongoing to make this as smooth as directory with a proper file name. Work is ongoing to make this as smooth as
possible. possible.
@ -45,7 +62,7 @@ I am not currently using LaTeX.
All of the work is sectioned into a `2024` directory for two reasons. All of the work is sectioned into a `2024` directory for two reasons.
Firstly, since all of the documents in the repository depend on the `nixpkgs` Firstly, since all of the documents in the repository depend on the `nixpkgs`
and `Typix` specified in the central `flake.nix`, breaking changes may require and `typst` specified in the central `flake.nix`, breaking changes may require
refactoring and maintenance of old documents. This is how `nixpkgs` works, but refactoring and maintenance of old documents. This is how `nixpkgs` works, but
these repositories host _documents_, not software. Thus, I have opted to these repositories host _documents_, not software. Thus, I have opted to
organize the tree in such way that each year should be its own standalone organize the tree in such way that each year should be its own standalone