2024-10-20 02:54:36 -07:00
|
|
|
# alexandria, an archive
|
2024-09-13 23:26:50 -07:00
|
|
|
|
2024-10-20 02:19:32 -07:00
|
|
|
of all of my digitized work and notes. Want to steal my stuff? This is where
|
|
|
|
you do it.
|
2024-09-13 23:26:50 -07:00
|
|
|
|
|
|
|
Please note, all of my work is licensed under [CC-BY-NC-ND
|
|
|
|
4.0](https://creativecommons.org/licenses/by-nc-nd/4.0/deed.en) (that's the
|
2024-10-20 02:50:17 -07:00
|
|
|
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
|
2024-12-29 03:22:13 -08:00
|
|
|
ending in `.nix` generally. The contents of `./quartz` are copyright Jerry Zhao
|
|
|
|
under the MIT License.
|
2024-10-20 02:16:20 -07:00
|
|
|
|
2024-10-20 02:19:32 -07:00
|
|
|
I (and the license) do not grant permission for my work being passed off as
|
2024-10-20 02:51:19 -07:00
|
|
|
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.
|
2024-10-20 02:19:32 -07:00
|
|
|
|
2024-12-29 03:22:13 -08:00
|
|
|
## Quartz 4 Web Deployment
|
|
|
|
|
|
|
|
The markdown files in this repository are Obsidian flavored and are
|
|
|
|
automatically compiled into the knowledge garden at
|
|
|
|
[garden.youwen.dev](https://garden.youwen.dev). Please visit!
|
|
|
|
|
2024-12-29 14:15:30 -08:00
|
|
|
### Hacking
|
|
|
|
|
|
|
|
Builds are powered by Nix. Run
|
|
|
|
|
|
|
|
```sh
|
|
|
|
nix build
|
|
|
|
```
|
|
|
|
|
|
|
|
to produce a static bundle at `result/public`. A local development server can
|
|
|
|
be started at `localhost:8080` by running
|
|
|
|
|
|
|
|
```sh
|
|
|
|
nix run
|
|
|
|
```
|
|
|
|
|
2024-10-20 02:16:20 -07:00
|
|
|
## Typst compilation infrastructure
|
|
|
|
|
|
|
|
This repository contains a sophisticated system for reproducibly compiling
|
|
|
|
Typst documents using Nix, the purely functional package manager. Typst is a
|
2024-10-20 02:16:46 -07:00
|
|
|
modern typesetting system aiming to replace the venerable LaTeX system.
|
2024-10-20 02:16:20 -07:00
|
|
|
|
2024-12-29 03:22:13 -08:00
|
|
|
Within the [documents](./documents), an ongoing experiment is taking place to
|
2024-10-20 02:16:20 -07:00
|
|
|
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](./2024/flake.nix)
|
|
|
|
for more information.
|
|
|
|
|
2024-12-29 03:22:13 -08:00
|
|
|
Since the flake in documents provides a package set, you can use the `nix
|
|
|
|
search` command on it to discover documents just like `nixpkgs`. Try:
|
2024-10-20 02:38:31 -07:00
|
|
|
|
|
|
|
```sh
|
2024-12-29 03:22:13 -08:00
|
|
|
nix search "git+https://code.youwen.dev/youwen5/alexandria?dir=documents" digression
|
2024-10-20 02:38:31 -07:00
|
|
|
```
|
|
|
|
|
|
|
|
You can compile any document in this repository yourself very easily! Simply
|
|
|
|
run:
|
2024-10-20 02:16:20 -07:00
|
|
|
|
|
|
|
```sh
|
2024-12-29 03:22:13 -08:00
|
|
|
nix build 'git+https://code.youwen.dev/youwen5/alexandria?dir=documents#digression-linear-algebra'
|
2024-10-20 02:16:20 -07:00
|
|
|
```
|
|
|
|
|
2024-10-20 02:38:31 -07:00
|
|
|
The builds are managed by the amazing
|
|
|
|
[typix](https://github.com/loqusion/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](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
|
2024-10-20 02:16:20 -07:00
|
|
|
directory with a proper file name. Work is ongoing to make this as smooth as
|
|
|
|
possible.
|