From cc5058278b7f962e6bd79e0584cababdb95b0780 Mon Sep 17 00:00:00 2001 From: pancaek <20342389+pancaek@users.noreply.github.com> Date: Sun, 1 Mar 2026 16:12:17 -0800 Subject: [PATCH] doc/installFonts: init hook docs in manual --- doc/hooks/index.md | 1 + doc/hooks/installFonts.section.md | 24 ++++++++++++++++++++++++ doc/redirects.json | 21 +++++++++++++++------ 3 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 doc/hooks/installFonts.section.md diff --git a/doc/hooks/index.md b/doc/hooks/index.md index 8338c4629fd0..bac8306ff10e 100644 --- a/doc/hooks/index.md +++ b/doc/hooks/index.md @@ -20,6 +20,7 @@ ghc.section.md gnome.section.md haredo.section.md installShellFiles.section.md +installFonts.section.md julec.section.md just.section.md libglycin.section.md diff --git a/doc/hooks/installFonts.section.md b/doc/hooks/installFonts.section.md new file mode 100644 index 000000000000..6c1c2c139313 --- /dev/null +++ b/doc/hooks/installFonts.section.md @@ -0,0 +1,24 @@ +# `installFonts` {#installfonts} + +This hook installs common font formats to the proper location. In its default state, the hook automatically handles ttf, ttc, otf, bdf, and psf. Given a `webfont` output, woff and woff2 formats will be installed under this output. + +The automatic behavior of the hook can be disabled by setting the `dontInstallFonts` variable to true. + +Additionally, it exposes the `installFont` function that can be used from your `postInstall` +hook, to install additional formats: + +## `installFont` {#installfonts-installfont} + +The `installFont` function takes two arguments, a file extension to move (*without* a preceding dot), and the install location. + +### Example Usage {#installfonts-installfont-exampleusage} + +```nix +{ + nativeBuildInputs = [ installFonts ]; + + postInstall = '' + installFont svg $out/share/fonts/svg + ''; +} +``` diff --git a/doc/redirects.json b/doc/redirects.json index f12f7ed29da9..9e22def037df 100644 --- a/doc/redirects.json +++ b/doc/redirects.json @@ -134,18 +134,21 @@ "inkscape-plugins": [ "index.html#inkscape-plugins" ], + "installfonts": [ + "index.html#installfonts" + ], + "installfonts-installfont": [ + "index.html#installfonts-installfont" + ], + "installfonts-installfont-exampleusage": [ + "index.html#installfonts-installfont-exampleusage" + ], "javascript-buildNpmPackage-npmFlags": [ "index.html#javascript-buildNpmPackage-npmFlags" ], "javascript-buildNpmPackage-npmWorkspace": [ "index.html#javascript-buildNpmPackage-npmWorkspace" ], - "libcxxhardeningextensive": [ - "index.html#libcxxhardeningextensive" - ], - "libcxxhardeningfast": [ - "index.html#libcxxhardeningfast" - ], "julec-hook": [ "index.html#julec-hook" ], @@ -182,6 +185,12 @@ "julec-hook-variables": [ "index.html#julec-hook-variables" ], + "libcxxhardeningextensive": [ + "index.html#libcxxhardeningextensive" + ], + "libcxxhardeningfast": [ + "index.html#libcxxhardeningfast" + ], "major-ghc-deprecation": [ "index.html#major-ghc-deprecation" ],