Skip to content

nixos-icons: allow customizing icon colors#2156

Open
OsiPog wants to merge 4 commits intonix-community:masterfrom
OsiPog:feat/nixos-icons-make-colors-overridable
Open

nixos-icons: allow customizing icon colors#2156
OsiPog wants to merge 4 commits intonix-community:masterfrom
OsiPog:feat/nixos-icons-make-colors-overridable

Conversation

@OsiPog
Copy link
Copy Markdown
Contributor

@OsiPog OsiPog commented Jan 24, 2026

This adds options for customization of the colors of the NixOS icons. Previously the colors were hard-coded to the semantically correct base16 values.
As suggested #2155 we also should here add something like colors.override to the target options as people might want to adjust these colors.
The problem is that this module cannot use mkTarget as this is solely an overlay module which as the documentation says should define the target with vanilla NixOS options.
So this PR adds the following options for changing the colors while still communicating that the options are different from the other override options (AI generated options overview):

The nix-snowflake-colours icon has a gradient on each lambda to show a subtle shadow on the tips. So the darker and lighter variants of the colors are updated accordingly when the main color (for example stylix.targets.nixos-icons.colors.nix-snowflake.light-blue for changing the light blue lambdas) is updated. But anyone is free to update the gradient colors can do that too. Even using the same function as the module does.

I would like the users to be able to use the hexColorAddRgb function so I just added it as a read-only option to the target. Is that the right procedure here?

closes #2155

@stylix-automation stylix-automation bot added topic: overlay Overlay changes topic: modules /modules/ subsystem labels Jan 24, 2026
@OsiPog OsiPog force-pushed the feat/nixos-icons-make-colors-overridable branch from 172a45c to d69a94a Compare January 24, 2026 23:21
@OsiPog OsiPog self-assigned this Jan 24, 2026
@OsiPog OsiPog requested review from danth and trueNAHO January 24, 2026 23:27
@OsiPog
Copy link
Copy Markdown
Contributor Author

OsiPog commented Jan 26, 2026

I'm not sure how to go about these changes. I think they're good in terms of customizability but maybe we should just allow to change the accent colors of the logos and apply the same shading to each.

nixos-icons is in a kinda unique position here as its (with gtksourceview) the only module that only defines an overlay and nothing else.

I think there should be some kind of mkOverlay function or we could extend mkTarget so that it might also take an optional overlay attribute which is handled the same way as config. So when given a function that takes colors as an argument the appropirate options in stylix.targets.<name> (colors.enable and colors.override) are generated. So that it doesn't differ from the configuration of other targets.

I was about to write something that simulates the behaviour of colors.override for this target but still having all the code for that in the nixos-icons module. But I decided not do that as we should communicate to the users that this target works different from the others.

Would it be a good idea to extend mkTarget in way that it works with overlays? Or is the risk of breaking everything too high? Should I rather simulate colors.override for this module eventhough the code will not be the same as in the other targets that provide colors.override?

Tell me what you think :)

@0xda157
Copy link
Copy Markdown
Contributor

0xda157 commented Jan 29, 2026

I think there should be some kind of mkOverlay function or we could extend mkTarget so that it might also take an optional overlay attribute which is handled the same way as config. So when given a function that takes colors as an argument the appropirate options in stylix.targets.<name> (colors.enable and colors.override) are generated. So that it doesn't differ from the configuration of other targets.

this was previously attempted in #1427

Would it be a good idea to extend mkTarget in way that it works with overlays? Or is the risk of breaking everything too high?

I think this would be good to attempt again, although not a part of mkTarget, instead reusing functionality similar to #1427

Copy link
Copy Markdown
Member

@trueNAHO trueNAHO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there should be some kind of mkOverlay function or we could extend mkTarget so that it might also take an optional overlay attribute which is handled the same way as config. So when given a function that takes colors as an argument the appropirate options in stylix.targets.<name> (colors.enable and colors.override) are generated. So that it doesn't differ from the configuration of other targets.

this was previously attempted in #1427

Would it be a good idea to extend mkTarget in way that it works with overlays? Or is the risk of breaking everything too high?

I think this would be good to attempt again, although not a part of mkTarget, instead reusing functionality similar to #1427

The mkTarget module system is already expressive enough to represent overlays. #2174 leverages the existing mkTarget logic and removes the separate overlay concept.

Tell me what you think :)

This PR is essentially what would have happened without our custom mkTarget module system. If #2174 works, this PR should be superseded by it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: modules /modules/ subsystem topic: overlay Overlay changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nixos-icons: add colors.override option

3 participants