all my work in academia in one place
Find a file
Youwen Wu 3cc1b22abb
2024/flake.lock: Update
Flake lock file updates:

• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/3d04084d54bedc3d6b8b736c70ef449225c361b1?narHash=sha256-K5ZLCyfO/Zj9mPFldf3iwS6oZStJcU4tSpiXTMYaaL0%3D' (2024-10-01)
  → 'github:hercules-ci/flake-parts/506278e768c2a08bec68eb62932193e341f55c90?narHash=sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS%2Bb4tfNFCwE%3D' (2024-11-01)
• Updated input 'flake-parts/nixpkgs-lib':
    'fb192fec7c.tar.gz?narHash=sha256-0xHYkMkeLVQAMa7gvkddbPqpxph%2BhDzdu1XdGPJR%2BOs%3D' (2024-10-01)
  → 'cc2f280002.tar.gz?narHash=sha256-lXvH/vOfb4aGYyvFmZK/HlsNsr/0CVWlwYvo2rxJk3s%3D' (2024-11-01)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/4c2fcb090b1f3e5b47eaa7bd33913b574a11e0a0?narHash=sha256-/uilDXvCIEs3C9l73JTACm4quuHUsIHcns1c%2BcHUJwA%3D' (2024-10-18)
  → 'github:NixOS/nixpkgs/23e89b7da85c3640bbc2173fe04f4bd114342367?narHash=sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w%3D' (2024-11-19)
• Updated input 'typix':
    'github:loqusion/typix/62d032735ad32a9a90225c06cb0857677fc753ee?narHash=sha256-piLZT8398O69hy0e3gX8hUWqSzbCslMCt10pT8d6c8E%3D' (2024-10-07)
  → 'github:loqusion/typix/1cd4c152d7b9f1995df654da8c416a978b3ff066?narHash=sha256-IKso%2BwX5Z0al6DV7DPLvEotlwchn6gHwI1jo%2Bm7pVgo%3D' (2024-11-20)
• Updated input 'typst-packages':
    'github:typst/packages/9bcf190c85da91be6df9f5fc25a93ce5812489cc?narHash=sha256-xdaQYNw1GApaJnXJO4WnUTNuYeRXisxIUSuAzVXFEW4%3D' (2024-10-18)
  → 'github:typst/packages/223228f19f6e81d15775406d5c3a0110c789ef20?narHash=sha256-/ffJWMfUpUFCFwPnqOgY566EUjqQUc57HJkFG/wCz0g%3D' (2024-11-19)
2024-11-20 19:51:06 -08:00
2024 2024/flake.lock: Update 2024-11-20 19:51:06 -08:00
.gitignore chore: add main.pdf to gitignore 2024-11-10 02:09:28 -08:00
LICENSE add license 2024-09-13 23:31:15 -07:00
README.md update readme 2024-10-20 02:54:36 -07:00

alexandria, an archive

of all of my digitized work and notes. Want to steal my stuff? This is where you do it.

Please note, all of my work is licensed under CC-BY-NC-ND 4.0 (that's the Creative Commons Attribution-Noncommercial-Noderivatives 4.0 license), with one exception. The Nix source code that helps provide the document compilation infrastructure is free and unencumbered software released into the public domain. This includes all of the files in ./2024/nix as well as any files ending in .nix generally. See more details in the source code README.

I (and the license) do not grant permission for my work being passed off as someone else's (perhaps for the purpose of plagiarism). Obviously this does not extend to the Nix source code, which is in the public domain.

Typst compilation infrastructure

This repository contains a sophisticated system for reproducibly compiling Typst documents using Nix, the purely functional package manager. Typst is a modern typesetting system aiming to replace the venerable LaTeX system.

Within the 2024 directory, an ongoing experiment is taking place to create a monorepo organization structure for a large amount of Typst documents. Some custom Nix infrastructure has been created to provide a similar package interface to the familiar nixpkgs package repository. Instead of building programs, however, it builds documents. Review the flake for more information.

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:

nix search "git+https://code.youwen.dev/youwen5/alexandria?dir=2024" digression

You can compile any document in this repository yourself very easily! Simply run:

nix build 'git+https://code.youwen.dev/youwen5/alexandria?dir=2024#digression-linear-algebra'

The builds are managed by the amazing typix project. It helps provide a 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, version locked in 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 possible.

Goal of the experiment

The end goal is to produce an easy-to-use infrastructure for creating personal repositories of Typst documents. LaTeX documents could feasibly be supported as well in the repository with some refactoring, but this is not a priority as the I am not currently using LaTeX.

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 and typst specified in the central flake.nix, breaking changes may require refactoring and maintenance of old documents. This is how nixpkgs works, but 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 repository. This means that a year's worth of documents can be frozen in time at the end to ensure that all of the existing documents will be able to reproducible compile in the future without any maintenance, as the nixpkgs and typst versions will be frozen in time.

Secondly, this will encourage further development each year to incrementally improve the infrastructure.

Eventually, if the experiment is successful, I may decide to create a standardized library or repository template for people to use.