From dabf5d8080e4610c177fc1a3da78ac45c55eab3e Mon Sep 17 00:00:00 2001 From: Tobias Frischmann Date: Wed, 5 Aug 2026 14:12:31 +0200 Subject: [PATCH] fix brocken brail --- hosts/laptop/configuration.nix | 1 + hosts/pc/configuration.nix | 1 + shared/font.nix | 41 ++++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 shared/font.nix diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix index 1bf6bfc..9202de2 100644 --- a/hosts/laptop/configuration.nix +++ b/hosts/laptop/configuration.nix @@ -14,6 +14,7 @@ ../../shared/cli.nix ../../shared/dev/mod.nix ../../shared/desktop.nix + ../../shared/font.nix # External modules inputs.hydration-notifier.nixosModules.default diff --git a/hosts/pc/configuration.nix b/hosts/pc/configuration.nix index d010e3d..9244a78 100644 --- a/hosts/pc/configuration.nix +++ b/hosts/pc/configuration.nix @@ -14,6 +14,7 @@ ../../shared/cli.nix ../../shared/dev/mod.nix ../../shared/desktop.nix + ../../shared/font.nix # External modules inputs.hydration-notifier.nixosModules.default diff --git a/shared/font.nix b/shared/font.nix new file mode 100644 index 0000000..da88a59 --- /dev/null +++ b/shared/font.nix @@ -0,0 +1,41 @@ +{ pkgs, ... }: + +{ + # Disable default packages to prevent bad fallback fonts (like freefont_ttf) + fonts.enableDefaultPackages = false; + fonts.fontconfig.enable = true; + fonts.fontDir.enable = true; + + fonts.packages = with pkgs; [ + # --- Primary Monospace & Nerd Fonts --- + nerd-fonts.jetbrains-mono + nerd-fonts.fira-code + + # --- System & UI Fonts (Noto / Liberation / DejaVu) --- + noto-fonts + noto-fonts-cjk-sans # Chinese / Japanese / Korean glyphs + noto-fonts-color-emoji # System-wide color emojis + liberation_ttf # Metrically compatible with Times/Arial/Courier + dejavu_fonts + ]; + + # Force Fontconfig priority so terminal/system pick the right fonts first + fonts.fontconfig.defaultFonts = { + monospace = [ + "JetBrainsMono Nerd Font" + "Noto Sans Mono" + "DejaVu Sans Mono" + ]; + sansSerif = [ + "Noto Sans" + "DejaVu Sans" + ]; + serif = [ + "Noto Serif" + "DejaVu Serif" + ]; + emoji = [ + "Noto Color Emoji" + ]; + }; +} -- 2.51.2