Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

123.12. nerd-fonts-symbols-3.5.1

Symbols Nerd Font — the icon codepoints a patched font carries, as a fallback face

Version 3.5.1, release 1
Shelf fonts — Font packages, and font libraries and tooling
Phase 41_system (System), 534 of 1047 in build order
Licence MIT
Homepage https://www.nerdfonts.com/
Build time 0.1 SBU
Installed size 4.9 MiB in 4 files
Recipe ports/core/fonts/nerd-fonts-symbols/kpkgbuild

About

Symbols Nerd Font carries the icon code points that “Nerd Font” patched fonts add (file-type icons, version-control and powerline glyphs, and the rest) as a face of its own, so they can be drawn as a fallback behind any font instead of from a patched copy of it. Prompt themes, file managers’ type columns and status bars use them. The port installs both upstream faces: Symbols Nerd Font, whose icons may be two cells wide, and Symbols Nerd Font Mono, whose icons fit one cell.

Why it is in KDOS

The comment above it in script/phases/41_system/packages.d/fonts.txt:

The glyph range a prompt theme, a file manager's type column and a status bar reach for. Upstream's own fontconfig rule prefers the PROPORTIONAL symbol face for monospace, which puts a double-width icon in a single cell; the recipe ships a corrected rule that keeps the cell grid's real family first.

Sources

Dependencies

Depends on: fontconfig.

Required by: no port names it.

Installation

From the repository root, inside the build container, this is the line kdosbuild runs for the port:

script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install nerd-fonts-symbols'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/fonts/nerd-fonts-symbols.

1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.

cd /ports/core/fonts/nerd-fonts-symbols
echo '01172f37db8543edb102e5cb5c64101c9f4686630804d49b419aa07b23a69996  nerd-fonts-symbols-3.5.1.tar.xz' | sha256sum -c -

2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.

SRC_ROOT=/var/cache/kpkg/work/nerd-fonts-symbols
SRC=$SRC_ROOT/nerd-fonts-symbols-3.5.1
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf nerd-fonts-symbols-3.5.1.tar.xz -C "$SRC" --strip-components=1

Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.

3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

tar xf "$PORT_SRC/$name-$version.tar.xz"

install -dm755 "$PKG/usr/share/fonts/nerd-fonts"
install -m644 SymbolsNerdFont-Regular.ttf SymbolsNerdFontMono-Regular.ttf \
	"$PKG/usr/share/fonts/nerd-fonts/"

install -Dm644 LICENSE "$PKG/usr/share/licenses/$name/LICENSE"

install -dm755 "$PKG/etc/fonts/conf.d"
cat > "$PKG/etc/fonts/conf.d/66-nerd-font-symbols.conf" <<'XML'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
  <alias>
    <family>monospace</family>
    <accept><family>Symbols Nerd Font Mono</family></accept>
  </alias>
  <alias>
    <family>Terminus</family>
    <accept><family>Symbols Nerd Font Mono</family></accept>
  </alias>
  <alias>
    <family>Terminus (TTF)</family>
    <accept><family>Symbols Nerd Font Mono</family></accept>
  </alias>
  <alias>
    <family>sans-serif</family>
    <accept><family>Symbols Nerd Font</family></accept>
  </alias>
  <alias>
    <family>serif</family>
    <accept><family>Symbols Nerd Font</family></accept>
  </alias>
</fontconfig>
XML

The common switches of each build system are explained in the Flag glossary.

4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/nerd-fonts-symbols, prunes what the image does not ship, lints the tree and rolls it reproducibly:

tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
    --mtime=@$SOURCE_DATE_EPOCH \
    --use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
    -cf nerd-fonts-symbols-3.5.1-1.tar.xz -C "$PKG" .

5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/nerd-fonts-symbols, and runs the triggers its paths call for.

Contents

Installed directories: /usr/share/fonts/nerd-fonts, /usr/share/licenses/nerd-fonts-symbols.

Notes

The release tarball is flat, with the fonts at its top level, and kpkg’s --strip-components=1 leaves $SRC without them, so build.sh unpacks the tarball again itself.

Upstream’s 10-nerd-font-symbols.conf is not installed: it puts the proportional face first in monospace, and a terminal then draws a double-width icon in a single cell. The recipe’s 66-nerd-font-symbols.conf instead <accept>s the Mono face behind monospace, Terminus and Terminus (TTF), and the proportional face behind sans-serif and serif, so a symbol face is used only for code points the requested face lacks. The two Terminus names are listed one by one, because a request for a concrete family carries no generic family for the monospace rule to match.