-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
treewide: wallpaper refactor #102
treewide: wallpaper refactor #102
Conversation
running into this weird error when building docs |
bee4b1c
to
329f219
Compare
ready for review when you've got time. |
@danth i think this is ready whenever you have time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MacOS tests should pass once you pull in 9197996 from the master branch.
We need to update the configuration page on the website to use the new constructors |
do we want to run checks on that wallpaper types that ensures there contents are of the correct types? |
That would be good if possible |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Converting these to functions (like toHex
, toInt
, toPolarity
) will make our lib
folder only depend on pkgs
and the upstream lib
, without reading anything from config
. I'm hoping that will allow it to be passed as a module argument without causing infinite recursion.
solid = color: pkgs.runCommand "${color}-pixel.png" { } "${pkgs.imagemagick}/bin/convert xc:#${color} png32:$out"; | ||
pixel = color: | ||
pkgs.runCommand "${color}-pixel.png" | ||
{ | ||
color = config.stylix.colors.withHashtag.${color}; | ||
} "${pkgs.imagemagick}/bin/convert xc:$color png32:$out"; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicated function.
What's the state of this PR (draft)? I'd be willing to help by rewriting and deduplicating the functions in |
@Sntx626 The main reason this isn't merged yet is because I'd like to remove the need to write out The things you mentioned should help towards that. It would also be useful to have more testing to make sure this doesn't break existing configs, or at least gives a helpful error message. |
Considering that several internal feature PRs are waiting for this PR to land, it might be better to refactor
However, considering the enormous rewrite, this should definitely happen before merging this PR. Personally, this PR and its direct dependants might be one of the most drastic improvements to this project so far. Thanks for all the work so far! For reference, the following PRs and issues depend on this PR:
For reference, the following PRs and issues should be improved based on this PR:
Feel free to add any PRs or issues I missed and to update the description of this PR to properly link the PRs and issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned in #251 (comment), the "black box" type introduced in 7a080cb is a genius type conversion abstraction.
However, I have my performance doubts about providing conversion functions instead of converted values. Specifically, does calling a conversion function multiple times convert multiple times or only once? Would static attribute sets not provide vastly better performance by caching their result? Additionally, the immutably converted data prevents any kind of conversion inconsistencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a valid concern.
However I think we should first measure the real-world impact of using the black box type and see if it is as bad as you think it could be. Or if there are other areas we should improve on first.
I also don't know enough about nix, but it could cache the result of the function and basically need to evaluate it only once. The optimization we seek might not even lay in this codebase.
Just an example of what would improve build times more:
I'm overriding all the colors myself. But stylix still generates a color palette from the bg image. I don't know if there's a way to turn that off, however running the genetic algorithm takes a lot of times. Which is not needed in my case afaik.
stylix: use functions in lib
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While functional, there's still room for improvement.
popupsOpacity-float = builtins.toString config.stylix.opacity.popups; | ||
|
||
backgroundPolarity = | ||
polarityFrom = colors: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently the function takes the color
attr set.
This makes it relatively simple to call the function.
However this argument is not type checked. This will result in misleading errors at best and is documented nowhere atm. (except for this comment...)
Should we take red
, green
and blue
as arguments instead?
@@ -2,33 +2,28 @@ | |||
|
|||
{ | |||
config.lib.stylix = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably create a library independent of config and tell the user how to extend their lib with ours.
This way we can finally be free of the config argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A completely separate library (stylix
/ stylixLib
or something) may be easier than trying to extend the existing lib
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a separate library is probably a better idea, extending lib doesnt seem to be worth the effort
Remove the local gitignore file because it is already upstream. Follows: danth#291
Closing this stale PR in favor of the proposal in #477 (comment), now tracked in the Roadmap. Thanks to everyone for the all valuable groundwork! |
Checklist
Potential Additions
Reference
The following depend or should be improved based on this PR:
stylix.fonts.sizes
units #251