Page:
Theming System
No results
1
Theming System
Fynn Mahringer edited this page 2026-07-28 14:49:25 +02:00
Theming system
The repo theme source of truth lives in:
- modules/themes//
- modules/system/stylix/default.nix
- modules/user/stylix/default.nix
- lib/stylix-catalog.nix
How it works
- A host selects a theme with
stylix.theme = "<name>";inhosts/<name>/configuration.nix. - The selected theme attrset from
modules/themes/<name>/default.nixis imported. - The system Stylix module maps that theme to:
- Base16 colors
- wallpaper/background image
- icon theme
- serif, sans, monospace, and emoji fonts
- cursor theme and size
- The user Stylix module applies the same polarity and background on the Home Manager side.
Theme background resolution
Wallpaper selection follows this order:
background.fileif the file exists inside the theme directorybackground.urlwithbackground.sha256- repo root
wallpaper.png
Theme structure
Each theme is expected to stay self-contained inside modules/themes/<name>/.
The theme may define:
- Base16 palette fields
base00throughbase0F backgroundiconsfonts- top-level
emoji cursor- metadata like
scheme,slug,author,description, andpolarity
Supported built-in assets
Icons:
candy-iconspapirus
Fonts:
ibm-plex-monoibm-plex-sansibm-plex-serifinterjetbrains-mono-nerdnoto-color-emojinoto-sansnoto-serif
Cursor themes:
bibata-modern-icecapitaine-cursorscapitaine-cursors-whiterose-pine-cursorrose-pine-dawn-cursor
Emoji fonts:
noto-color-emoji
Current repo themes
catppuccin-frappecatppuccin-mochadraculaembergruvbox-dark-hardgruvbox-dark-mediumgruvbox-light-hardgruvbox-light-mediummonokaiorichalcumuwunicorn
Theme template
The template for creating a new theme lives at:
/home/ftmahringer/nixos-config/modules/themes/TEMPLATE/default.nix/home/ftmahringer/nixos-config/modules/themes/TEMPLATE/README.md
Template notes:
This template supports the same optional fields as your live themes:
background,icons,fonts,emoji, andcursor, plus the required Base16 palette values.Place your theme-local wallpaper here, for example as
wallpaper.png,wallpaper.jpg,wallpaper.svg, orwallpaper.gif, and then pointbackground.fileat it fromdefault.nix.Wallpaper fallback order:
background.fileif the file existsbackground.urlwithbackground.sha256/home/ftmahringer/nixos-config/wallpaper.png
Template example:
{
scheme = "Template";
slug = "ft-theme-template";
author = "Fynn Mahringer";
description = "Just a tempalte for adding more themes later";
polarity = "dark";
# Background priority:
# 1. Use `background.file` if it exists.
# 2. Otherwise use `background.url` with `background.sha256`.
# 3. Otherwise fall back to `/home/ftmahringer/nixos-config/wallpaper.png`.
background = {
file = ./wallpaper.png;
# Optional remote fallback:
# url = "https://example.com/wallpaper.png";
# sha256 = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
};
# Optional icon theme.
# Supported values currently:
# - "papirus"
# - "candy-icons"
# Unknown values fall back to the config default.
icons = "papirus";
# Optional font selection.
# Supported values currently:
# - "noto-serif"
# - "noto-sans"
# - "inter"
# - "ibm-plex-serif"
# - "ibm-plex-sans"
# - "ibm-plex-mono"
# - "jetbrains-mono-nerd"
# - "noto-color-emoji"
# Unknown values fall back to the config defaults.
fonts = {
serif = "noto-serif";
sansSerif = "noto-sans";
monospace = "jetbrains-mono-nerd";
emoji = "noto-color-emoji";
# Optional size overrides:
# sizes = {
# applications = 12;
# desktop = 11;
# popups = 11;
# terminal = 12;
# };
};
# Optional top-level emoji override.
# If omitted, `fonts.emoji` is used.
# Unknown values fall back to the config default.
# emoji = "noto-color-emoji";
# Optional cursor theme.
# Supported values currently:
# - "bibata-modern-ice"
# - "capitaine-cursors"
# - "capitaine-cursors-white"
# - "rose-pine-cursor"
# - "rose-pine-dawn-cursor"
# Unknown values fall back to the config default.
cursor = {
family = "bibata-modern-ice";
size = 24;
};
# The remaining fields are the Base16 palette used by Stylix.
# Keep these as 6-character hex values without `#`.
base00 = "000000";
base01 = "111111";
base02 = "222222";
base03 = "333333";
base04 = "444444";
base05 = "cccccc";
base06 = "dddddd";
base07 = "eeeeee";
base08 = "ff5555";
base09 = "ffb86c";
base0A = "f1fa8c";
base0B = "50fa7b";
base0C = "8be9fd";
base0D = "6272a4";
base0E = "bd93f9";
base0F = "ff79c6";
}