Recently I’ve updated my flake and nixos-rebuild informed me of the new syntax of nerd-fonts, so now I have:
...
nerd-fonts.jetbrains-mono
...
However it doesn’t work and apps can’t find the font. This is the error from kitty for example:
fast_data_types.FreeTypeError: Failed to load face from path: /home/me/.nix-profile/share/fonts/truetype/NerdFonts/JetBrainsMonoNerdFont-SemiBold.ttf with error: cannot open resource
[0.072] Failed to convert descriptor to face for bold font
I’ve examined this path and it turns out all jetbrainsmono fonts are now placed under NerdFonts/JetBrainsMono while kitty is looking for it one directory higher.
At the same time setting this font in nixos configuration works just fine.
According the migration content in the pr you want to switch to
home.packages = with pkgs; [
nerd-fonts.jetbrains-mono
];
Which should be equivalent to your old declaration as far as i can see.
edit: nvm, saw that you tried that out
edit2:
You might want to double check your kitty config if that is refering the path somewhere.
What i actually see is that there is a change in the path from share/fonts/truetype/NerdFonts/JetBrainsMonoNerdFont-SemiBold.ttf to share/fonts/truetype/NerdFonts/JetBrainsMono/JetBrainsMonoNerdFont-SemiBold.ttf , so either the config or some font cache might refer to the old/wrong font location
Weird, I’m seeing that fc-cache -r (you need -r not just -f) is working for everything except kitty. I literally even uninstalled and re-installed all of nix in my non-NixOS system and still kitty (built from nix) is looking in the non-existent location that has never existed or had fonts in it as long as kitty has been present.
I’m also seeing numerous other people reporting the same thing, specifically with kitty.
What did you do to get kitty to look in the new locations? I’ve updated my flakes to get the latest kitty from nix-unstable, I don’t see anything hardcoded in the kitty derivation that would explain the paths that don’t exist, and I’ve verified repeatedly that fc-list and sudo fc-list don’t list anything that’s directly in the NerdFonts folder.