I updated my nixos to 25.05 but now some of my fonts are broken and i have no what it causing it.
My nixos config:
linuxchr/nix - Codeberg.org
I also have following error when starting alacrity:
Created log file at “/tmp/Alacritty-6905.log”
[0.043873057s] [ERROR] [alacritty] Cannot open resource
Deleted log file at “/tmp/Alacritty-6905.log”
Error: Font(PlatformError(“Cannot open resource”))
3 Likes
Hi,
I also had issue with the font change in 25.05
What solved it for me was to be on 24.11
, then do a nixos-rebuild boot
instead of nixos-rebuild switch
Other solution that might work for you is to do sudo fc-cache -rv
+ reboot
/logout
After looking at your repo
, I only see one thing that seems weird:
Why are you getting all nerd-fonts
and not only the one you use?
Here is my home-manager
config in comparison: nixconf/user/alex/home/font/default.nix at 4356803c8499001cbb2d419114d3c6f9f3d2043d · Alexdelia/nixconf · GitHub
Here is my merge
commit
with all changes between 24.11
and 25.05
Merge pull request #5 from Alexdelia/25.05 · Alexdelia/nixconf@4356803 · GitHub
I figured out the line causing the problem:
monospace = {
package = pkgs.nerd-fonts.jetbrains-mono;
name = "JetBrainsMono Nerd Font";
};
It is in Making sure you're not a bot!
When having it in the config my fonts break when not everything works, but if i remove the line i no longer have my fonts set to JBM Nerd Font of course. It probably has something to do with stylix.
you can do fc-list
to list your available fonts
also, you are still using
stylix.url = "github:danth/stylix/release-25.05";
you might want to use
stylix.url = "github:nix-community/stylix/release-25.05";
it shouldn’t be the root cause of the font issue
Already did, JetBrainsMono Nerd Font is listed there. Cant paste output as i did it with Strg+ALT+F2 as my terminal broke with the update.
Extra tip
I also have following error when starting alacrity:
Created log file at “/tmp/Alacritty-6905.log”
[0.043873057s] [ERROR] [alacritty] Cannot open resource
Deleted log file at “/tmp/Alacritty-6905.log”
Error: Font(PlatformError(“Cannot open resource”))
I had the same issue with alacritty
, it got solved the same way
Hi,
I also had issue with the font change in 25.05
What solved it for me was to be on 24.11, then do a nixos-rebuild boot instead of nixos-rebuild switch
Other solution that might work for you is to do sudo fc-cache -rv + reboot/logout
After looking at your repo, I only see one thing that seems weird:
Why are you getting all nerd-fonts and not only the one you use?
Here is my home-manager config in comparison: nixconf/user/alex/home/font/default.nix at 4356803c8499001cbb2d419114d3c6f9f3d2…
To get more info, you can do alacritty -vvv
Currently use an alternative terminal with working fonts:
Opening with nvim over neovide. Running :terminal
Alacritty log:
[0.022817072s] [INFO ] [alacritty] Window scale factor: 1
[0.024096267s] [DEBUG] [alacritty] Loading "JetBrainsMono Nerd Font" font
[0.045498448s] [TRACE] [crossfont] Number of fonts is 45
[0.045523156s] [TRACE] [crossfont] Got font path="/home/christian/.nix-profile/share/fonts/truetype/NerdFonts/JetBrainsMonoNerdFont-Regular.ttf", index=0
[0.045543363s] [ERROR] [alacritty] Cannot open resource
[0.050937899s] [TRACE] [crossfont] Number of fonts is 45
[0.050961167s] [TRACE] [crossfont] Got font path="/home/christian/.nix-profile/share/fonts/truetype/NerdFonts/JetBrainsMonoNerdFont-Regular.ttf", index=0
[0.051788374s] [INFO ] [alacritty] Goodbye
Deleted log file at "/tmp/Alacritty-3484.log"
Error: Font(PlatformError("Cannot open resource"))
Now i can remove the before mentioned stylix lines and my fonts stays on JBM. But i still want to have this stylix line.
I’m sorry, I do not know how to solve this issue in your situation
The issue home-manager/issues/7098
indicate that fc-match
changed behavior in home-manager
:
opened 06:36PM - 20 May 25 UTC
closed 01:04AM - 22 May 25 UTC
bug
triage
### Are you following the right branch?
- [x] My Nixpkgs and Home Manager versi… ons are in sync
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Issue description
I configure my fonts through the system-level settings in NixOS, and I have enabled `fontconfig` support from both NixOS and Home Manager. My font configuration can be found here:
👉 [https://github.com/ccicnce113424/nixos-config/blob/0d1b1db2feb92d5ab8df85a1ac835774df3de82a/profile/common/desktop/fonts.nix](https://github.com/ccicnce113424/nixos-config/blob/0d1b1db2feb92d5ab8df85a1ac835774df3de82a/profile/common/desktop/fonts.nix)
Before #7045 , the output of `fc-match` without any arguments was:
```shell
fc-match
NotoSansCJK-VF.otf.ttc: "Noto Sans CJK SC" "Regular"
```
This matched the preferred sans-serif font I specified in the NixOS system configuration and was the intended behavior.
However, after that commit, the output changed to:
```shell
fc-match
msyh.ttc: "Microsoft YaHei" "Regular"
```
The font displayed in applications changed accordingly. Importantly, I did not change any font configuration before or after that commit.
This change has a significant impact on the user experience and is quite disastrous for me personally. I hope that `fontconfig` can be restored to its previous behavior.
### Maintainer CC
@Rosuavio
@ilkecan
### System information
```markdown
❯ nix-shell -p nix-info --run "nix-info -m"
- system: `"x86_64-linux"`
- host os: `Linux 6.14.6, NixOS, 25.11 (Xantusia), 25.11.20250518.292fa7d`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.28.3`
- nixpkgs: `/nix/store/wkjmkjrfr9ik1blw8zmv9g5xjl412py8-source`
```
I wonder if it’s related and a nix flake update
without more tinkering of your config would solve your issue
I really hope that you find a solution, for you and everyone that will have the same problems.
nix flake update
, it did this some many times that i have hit the github rest api limit.
1 Like
Apparently, another solution might be to:
FWIW, manually removing ~/.cache/fontconfig
and re-running fc-cache -vr
finally cleared the issue up for me.
opened 04:41PM - 01 Dec 24 UTC
closed 01:02PM - 26 Apr 25 UTC
bug
status: stale
triage
### Are you following the right branch?
- [X] My Nixpkgs and Home Manager versi… ons are in sync
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Issue description
Hello,
I am using home-manager with nixpkgs in a [flake](https://github.com/gautaz/phoenix), both on master.
Lately a modification occurred on nixpkgs on how the nerdfonts are packaged (see https://github.com/NixOS/nixpkgs/commit/de4dbc58fdeb84694d47d6c3f7b9f04a57cc4231).
Since this modification, [alacritty](https://github.com/gautaz/phoenix/blob/main/homes/del/alacritty.nix) seems unable to load the fonts.
Following are my findings while looking at the issue.
Here are the Alacritty logs:
```console
❯ alacritty -vvv
Created log file at "/tmp/Alacritty-362931.log"
[0.000005494s] [INFO ] [alacritty] Welcome to Alacritty
[0.000146170s] [INFO ] [alacritty] Version 0.14.0
[0.000172330s] [INFO ] [alacritty] Running on X11
[0.000465610s] [INFO ] [alacritty] Configuration files loaded from:
"/home/del/.config/alacritty/alacritty.toml"
[0.014992067s] [INFO ] [alacritty] Using GLX 1.4
[0.036289958s] [DEBUG] [alacritty] Picked GL Config:
buffer_type: Some(Rgb { r_size: 8, g_size: 8, b_size: 8 })
alpha_size: 8
num_samples: 0
hardware_accelerated: true
supports_transparency: Some(true)
config_api: Api(OPENGL | GLES1 | GLES2)
srgb_capable: false
[0.037263012s] [INFO ] [alacritty] Window scale factor: 1.5
[0.039188894s] [DEBUG] [alacritty] Loading "UbuntuMono Nerd Font" font
[0.043615403s] [TRACE] [crossfont] Number of fonts is 18
[0.043643459s] [TRACE] [crossfont] Got font path="/home/del/.nix-profile/share/fonts/truetype/NerdFonts/UbuntuMonoNerdFont-Regular.ttf", index=0
[0.043661603s] [ERROR] [alacritty] Cannot open resource
```
The font path used by alacritty is the one listed by `fc-list`:
```console
❯ fc-list | grep UbuntuMonoNerdFont-Regular.ttf
/home/del/.nix-profile/share/fonts/truetype/NerdFonts/UbuntuMonoNerdFont-Regular.ttf: UbuntuMono Nerd Font:style=Regular
/nix/store/g2q1gshfnqdnbidgp1my1iwm5747iqng-home-manager-path/share/fonts/truetype/NerdFonts/UbuntuMono/UbuntuMonoNerdFont-Regular.ttf: UbuntuMono Nerd Font:style=Regular
```
But the path is obviously not the right one:
```console
❯ ls /home/del/.nix-profile/share/fonts/truetype/NerdFonts/UbuntuMonoNerdFont-Regular.ttf
ls: cannot access '/home/del/.nix-profile/share/fonts/truetype/NerdFonts/UbuntuMonoNerdFont-Regular.ttf': No such file or directory
```
The fonts are in fact located here:
```console
❯ ls /home/del/.nix-profile/share/fonts/truetype/NerdFonts/UbuntuMono/
UbuntuMonoNerdFont-BoldItalic.ttf UbuntuMonoNerdFontMono-BoldItalic.ttf UbuntuMonoNerdFontMono-Regular.ttf UbuntuMonoNerdFontPropo-Italic.ttf
UbuntuMonoNerdFont-Bold.ttf UbuntuMonoNerdFontMono-Bold.ttf UbuntuMonoNerdFontPropo-BoldItalic.ttf UbuntuMonoNerdFontPropo-Regular.ttf
UbuntuMonoNerdFont-Italic.ttf UbuntuMonoNerdFontMono-Italic.ttf UbuntuMonoNerdFontPropo-Bold.ttf UbuntuMonoNerdFont-Regular.ttf
```
If anyone has an idea of how to fix/workaround this, I will be happy to try :slightly_smiling_face:.
### Maintainer CC
@rycee
### System information
```markdown
- system: `"x86_64-linux"`
- host os: `Linux 6.6.63, NixOS, 25.05 (Warbler), 25.05.20241128.d584552`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.24.10`
- nixpkgs: `/etc/nixpkgs/channels/nixpkgs`
```
in your case, you might want to see where ~/.nix-profile/share/fonts
leads to and maybe removing it before a nixos-rebuild boot
I wish you luck and I won’t hesitate to answer more if I find more
4 Likes
Also fixed it for me, thanks for helping
4 Likes
burk3
May 26, 2025, 3:34am
15
I was in the same boat and just running fc-cache -vr
fixed it for me (and after restarting affected apps of course).
Fonts broke with me too. Particularly rofi and fixed width in Firefox. Appears all uppercase. So far the work arounds mentioned above, e.g. deleting/recreating the cache has not helped.
Work around for me is to remove font-awesome from home.packages
in home-manager.
At least it works for Firefox and rofi. Sway is still bad, but I haven’t restarted that yet. I imagine it should come good after restarting.
I just had the issue on arm M1
fedora asahi
with home-manager
only had to do
rm -rf ~/.cache/fontconfig/
sudo fc-cache -rv
and it was fixed
didn’t need to reboot or logout for alacritty
and other programs to work right away