Skip to main content

Module fleet_fonts

Module fleet_fonts 

Source
Expand description

Fleet-fonts renderer — typed Nix attrset every pleme-io GUI app’s home-manager module imports to (a) name the canonical font family and (b) install the underlying nixpkgs package via home.packages.

Why this exists separately from stylix_fonts:

  • stylix_fonts produces the stylix-shaped { monospace, sansSerif, serif, emoji } attrset that foreign apps (GTK, alacritty, kitty, btop, k9s, …) read via the stylix theme. Stylix has exactly four font slots.

  • fleet_fonts produces a GPU-app-shaped { primary, italic, bold, symbols, emoji, fallback_chain } attrset that pleme-io’s own terminal emulators (mado today; fumi / kagi / hibiki / namimado / nami next) consume directly via flake input. It carries the italic + symbols faces stylix doesn’t model, plus the explicit package reference each HM module needs to home.packages = [ … ] so the underlying font is actually installed on the operator’s machine.

The two surfaces are sibling projections of the same typed Typography token — changing MonoFonts::pleme() in ishou-tokens is the single source of truth for both. Adding a new font slot is a one-line edit in typography.rs; both renderers regenerate in lockstep.

§Output shape

{ pkgs }:
{
  primary = { name = "JetBrainsMono Nerd Font"; package = pkgs.nerd-fonts.jetbrains-mono; };
  italic  = { name = "Iosevka"; style_intent = "calligraphic"; package = pkgs.iosevka; };
  bold    = { name = "JetBrainsMono Nerd Font"; package = pkgs.nerd-fonts.jetbrains-mono; };
  symbols = { name = "Symbols Nerd Font Mono"; package = pkgs.nerd-fonts.symbols-only; };
  emoji   = { name = "Apple Color Emoji"; fallback_name = "Noto Color Emoji"; package = null; };
  fallback_chain = [ "Symbols Nerd Font Mono" "FiraCode Nerd Font" … ];
}

§Consumer pattern

Every fleet GUI app’s HM module imports this attrset and uses it to (a) name the canonical family in its font.family default and (b) install the underlying package(s) declaratively:

let fonts = import inputs.ishou.packages.${system}.fleet-fonts
              { inherit pkgs; };
in {
  options.myapp.font.family = lib.mkOption {
    default = fonts.primary.name;
  };
  config.home.packages = [
    fonts.primary.package
    fonts.italic.package
    fonts.symbols.package
  ];
}

Functions§

render
Render the canonical fleet-fonts Nix attrset.