No description
Find a file
Kristian Krsnik 3c3e0acfaf
Some checks failed
Code QUality Checks / Checks (push) Failing after 11s
fixed readme
2025-09-08 20:27:48 +02:00
.forgejo/workflows updated 2025-09-08 20:25:55 +02:00
checks updated 2025-09-08 20:25:55 +02:00
lib updated 2025-09-08 20:25:55 +02:00
overlays updated 2025-09-08 20:25:55 +02:00
shells formatting 2025-06-08 23:10:01 +02:00
templates formatting 2025-06-08 23:10:01 +02:00
.gitignore updated 2025-09-08 20:25:55 +02:00
flake.lock hello 2025-04-21 00:01:16 +02:00
flake.nix updated 2025-09-08 20:25:55 +02:00
main.pdf hello 2025-04-21 00:01:16 +02:00
README.md fixed readme 2025-09-08 20:27:48 +02:00

Typst-nix

A nix library to develop and build Typst projects.

Features

  • Unit Tests
  • Create packages
  • Allow fonts
  • Watch script configured like the build environment.
  • Shell environment configures like the build environment.
  • Support almost all Typst command line options.

Documentation

lib.<system>.mkTypstDerivation

Inputs

{
  src,
  name ? removeSuffix ".typ" (baseNameOf entrypoint),
  entrypoint ? "main.typ",
  fonts ? [ ],
  packages ? [ ],
  inputs ? { },
  format ? "pdf", # The format of the output file.
  ppi ? 144, # The PPI (pixels per inch) to use for PNG export
  typst ? args.typst,
  numberFormat ? "{0p}-of-{t}", # The format of the output file, inferred from the extension by default.
  creationTimestamp ? 0, # The document's creation date formatted as a UNIX timestamp.
  pages ? "1-", # Which pages to export. When unspecified, all document pages are exported.
  jobs ? 0, # Number of parallel jobs spawned during compilation, defaults to number of CPUs.
  timings ? false, # Produces performance timings of the compilation process (experimental).
}

lib.<system>.mkWatchTypstProject

Inputs

{
  name ? removeSuffix ".typ" (baseNameOf entrypoint),
  entrypoint ? "main.typ",
  fonts ? [ ],
  packages ? [ ],
  inputs ? { },
  format ? "pdf", # The format of the output file.
  ppi ? 144, # The PPI (pixels per inch) to use for PNG export
  typst ? args.typst,
  numberFormat ? "{0p}-of-{t}", # The format of the output file, inferred from the extension by default.
  creationTimestamp ? 0, # The document's creation date formatted as a UNIX timestamp.
  pages ? "1-", # Which pages to export. When unspecified, all document pages are exported.
  jobs ? 0, # Number of parallel jobs spawned during compilation, defaults to number of CPUs.
  open ? false,
  viewer ?
    if format == "html" then
      getExe xdg-utils # Open in default browser.
    else
      getExe zathura, # Open in a lightweight, automatically reloading PDF and image viewer.
  out ? null, # Which directory to save the temporary output. Default: Create a new temporary directory.
  keepOut ? false,
  timings ? false, # Produces performance timings of the compilation process (experimental).
  port ? null, # The port where HTML is served.
  noServe ? false, # Disables the built-in HTTP server for HTML export.
  noReload ? false, # Disables the injected live reload script for HTML export.
}