Fonts: Difference between revisions
| Line 41: | Line 41: | ||
This will cause NixOS to download only the [https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts/FiraCode Fira Code] and [https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts/DroidSansMono Droid Sans Mono] fonts from [https://github.com/ryanoasis/nerd-fonts nerd-fonts] instead of the whole package. The relevant names can be found by looking at the file name for your relevant font on the [https://github.com/ryanoasis/nerd-fonts/releases official release page] assets. | This will cause NixOS to download only the [https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts/FiraCode Fira Code] and [https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts/DroidSansMono Droid Sans Mono] fonts from [https://github.com/ryanoasis/nerd-fonts nerd-fonts] instead of the whole package. The relevant names can be found by looking at the file name for your relevant font on the [https://github.com/ryanoasis/nerd-fonts/releases official release page] assets. | ||
=== Let Fontconfig know the fonts within your Nix | === Let Fontconfig know the fonts within your Nix profile === | ||
Nix inserts its user profile path into <code>$XDG_DATA_DIRS</code>, which Fontconfig by default doesn't look in. This cause graphical applications like KDE Plasma not able to recognize the fonts installed via <code>nix-env</code> or <code>nix profile</code>. | Nix inserts its user profile path into <code>$XDG_DATA_DIRS</code>, which Fontconfig by default doesn't look in. This cause graphical applications like KDE Plasma not able to recognize the fonts installed via <code>nix-env</code> or <code>nix profile</code>. | ||
| Line 49: | Line 49: | ||
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"> | <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"> | ||
<fontconfig> | <fontconfig> | ||
<!-- | <!-- NIX_PROFILE is the path to your Nix profile. See Nix Reference Manual for details. --> | ||
<dir> | <dir>NIX_PROFILE/lib/X11/fonts</dir> | ||
<dir> | <dir>NIX_PROFILE/share/fonts</dir> | ||
</fontconfig> | </fontconfig> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
and run <code>fc-cache</code>. | and run <code>fc-cache</code>. | ||
Alternatively, | Alternatively, [https://nix-community.github.io/home-manager/options.xhtml#opt-fonts.fontconfig.enable enable Fontconfig configuration] in your Home Manager configuration. | ||
=== Imperative installation of user fonts === | === Imperative installation of user fonts === | ||