Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fonts: behaviour is different when in a specialisation #540

Open
mighty-spirit opened this issue Aug 30, 2024 · 3 comments
Open

fonts: behaviour is different when in a specialisation #540

mighty-spirit opened this issue Aug 30, 2024 · 3 comments
Labels
bug Something isn't working properly

Comments

@mighty-spirit
Copy link

mighty-spirit commented Aug 30, 2024

Hi, and first of all: Amazing nixos module! Thanks so much, it's awesome : )

I use "Fira Code" in all my stylix.fonts settings and I have "Open Sans" declared in gtk.font.name option in home manager for gtk apps. When I am on my base configuration, this works exactly as I want. Terminals use Fira and gtk apps use Sans.

However, when I switch to my light-theme specialisation, which is set to simply inherits all font configs of the base configuration, gtk apps then switch to Fira too, even though both gtk and firefox settings still say that they use Open Sans in their configuration. I even tried to set in firefox to explicitly Open Sans, but in this specialisation, it still uses Fira.

Which just makes me wonder, any idea, why would stylix respect gtk font setting in one case and override them in the other?

And in case that there would not be solution to this, I wondered if it would be possible to get stylix.fonts.enable option, which could be set to false to be able to configure fonts manually?

@trueNAHO
Copy link
Collaborator

Which just makes me wonder, any idea, why would stylix respect gtk font setting in one case and override them in the other?

Unfortunately, I have not had the time to incorporate specialisations into my own setup, which means that my help is somewhat limited.

Maybe one of the discussions mentioned in #530 could help.

I wondered if it would be possible to get stylix.fonts.enable option, which could be set to false to be able to configure fonts manually?

I will consider this when cleaning up the codebase.

@trueNAHO trueNAHO added the bug Something isn't working properly label Aug 31, 2024
@danth
Copy link
Owner

danth commented Aug 31, 2024

Are you using NixOS in addition to Home Manager, and if so, do you have them combined into one configuration or are you running Home Manager independently? I'm wondering if this could be caused by the way NixOS copies the settings from your main configuration into the specialisation.

Also, have you considered setting stylix.fonts.sansSerif to Open Sans rather than changing the underlying option?

@danth danth changed the title Stylix and Gtk font settings fonts: behaviour is different when in a specialisation Aug 31, 2024
@mighty-spirit
Copy link
Author

mighty-spirit commented Sep 1, 2024

Also, have you considered setting stylix.fonts.sansSerif to Open Sans rather than changing the underlying option?

Setting stylix.fonts.sansSerif to Open Sans actually did help to force gtk apps to use it even in the specialisation, but it also forced it on alacritty and foot terminals, as they then refuse to use Fira Code in both base config and specialisation.

Are you using NixOS in addition to Home Manager, and if so, do you have them combined into one configuration or are you running Home Manager independently? I'm wondering if this could be caused by the way NixOS copies the settings from your main configuration into the specialisation.

That will surely be it. Base configuration and specialisation must evaluate/inherit nix expression in different order when they are being built, and that is what produces different end results. To my limited knowledge (I am still very new to nix), I have Nixos and Home-Manager combined into one configuration. Very much like with Stylix, I use Home-Manager as Nixos Module.

I will play around with setting higher value to home-manager gtk.font.name option and let you know if that helped.

Thanks to both of you and wish you having a great day!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working properly
Projects
None yet
Development

No branches or pull requests

3 participants