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

Overriding Gnome template #621

Open
musjj opened this issue Nov 11, 2024 · 7 comments
Open

Overriding Gnome template #621

musjj opened this issue Nov 11, 2024 · 7 comments

Comments

@musjj
Copy link
Contributor

musjj commented Nov 11, 2024

I wanted to override a few colors for Gnome (without recreating all the needed derivations), but it looks like that the template is hardcoded.

There's this relevant thread: #159 about moving these templates out-of-tree. Would a PR for separating the mustache template to a different repo be acceptable here?

@trueNAHO
Copy link
Collaborator

I wanted to override a few colors for Gnome (without recreating all the needed derivations), but it looks like that the template is hardcoded.

Ideally, we would upstream (NixOS, Home Manager, or nix-darwin) relevant options to seamlessly integrate Stylix into external Nix code.

There's this relevant thread: #159 about moving these templates out-of-tree. Would a PR for separating the mustache template to a different repo be acceptable here?

The future Vim highlight groups would allow us to get rid of mustache templates:

the roadmap eventually causes Stylix to implement all templates without relying on external dependencies

-- #567 (comment)

@musjj
Copy link
Contributor Author

musjj commented Nov 14, 2024

Are the patches really suitable for upstreaming though? It contains a lot of stylix-specific changes, like removing dark mode. The style sheet itself is also fairly opinionated and custom, which is not something I usually see upstream.

@trueNAHO
Copy link
Collaborator

Are the patches really suitable for upstreaming though? It contains a lot of stylix-specific changes, like removing dark mode. The style sheet itself is also fairly opinionated and custom, which is not something I usually see upstream.

My idea was to move our string injection architecture

xdg.configFile."<MODULE>".text = "<KEY>=<VALUE>";

upstream, and then we only use its interface:

programs.<MODLE>.extraConfig."<KEY>" = "<VALUE>";

This centralizes the string injection upstream and hopefully gets rid of override issues:

the use of extraConfig might cause other potentially related issues. As discussed in #159 (comment), it makes it harder to override options, and as discussed in #388 (comment), it makes it easier to accidentally override Stylix options.

-- #395

@musjj
Copy link
Contributor Author

musjj commented Nov 14, 2024

I see, but in the case for Gnome you can't feed the values via xdg.configFile though. The Gnome module involves a lot of patching, so upstreaming them all to NixOS + home-manager seems unlikely IMO.

I think a more sensible short-term approach is to import the template files via the inputs in flake.nix (using url = "path:./templates/..." so you don't have to make a bunch of repositories). This will allow the user to override it. The downside is that you can't override it partially. What do you think?

@trueNAHO
Copy link
Collaborator

I see, but in the case for Gnome you can't feed the values via xdg.configFile though. The Gnome module involves a lot of patching, so upstreaming them all to NixOS + home-manager seems unlikely IMO.

Yes.

I think a more sensible short-term approach is to import the template files via the inputs in flake.nix (using url = "path:./templates/..." so you don't have to make a bunch of repositories). This will allow the user to override it. The downside is that you can't override it partially. What do you think?

This sounds like a really good short-term solution. Feel free to submit a PR.

@trueNAHO
Copy link
Collaborator

I think a more sensible short-term approach is to import the template files via the inputs in flake.nix (using url = "path:./templates/..." so you don't have to make a bunch of repositories). This will allow the user to override it. The downside is that you can't override it partially. What do you think?

This sounds like a really good short-term solution. Feel free to submit a PR.

Actually, would it not be better to do this with an option, like stylix.targets.gnome.theme?

@musjj
Copy link
Contributor Author

musjj commented Nov 18, 2024

Yeah, a stylix.targets.gnome.theme option might be better here if that's allowed. I'm starting to think that overriding templates might not be as useful in Gnome 47 due to: #618, which may require search-replace patching over the css files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants