-
-
Notifications
You must be signed in to change notification settings - Fork 307
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
plugins/alpha: migrate to mkNeovimPlugin #3040
base: main
Are you sure you want to change the base?
plugins/alpha: migrate to mkNeovimPlugin #3040
Conversation
plugins/by-name/alpha/default.nix
Outdated
plugins.alpha.luaConfig.content = | ||
optionalString themeDefined "require('alpha').setup(${toLuaObject cfg.theme})\n" | ||
+ "require('alpha.term')"; |
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'm a little confused. You have a settings
option, but you are also manually calling setup and passing it a theme
option.
The idea of settings
is that it is the nix representation of the lua passed to setup
.
Usually, mkNeovimPlugin will take responsibility for calling setup
and passing it the settings
.
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.
.setup
needs to be manually called when using theme
option. Because that is the only way we can set pre-defined themes. That's why, theme
and settings.layout
options can't be used at the same 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.
If so, that also implies:
settings
as a whole must not be used when a theme is definedsetup
must always be called manually, either passing itsettings
ortheme
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.
Interesting, the upstream examples show a different usage:
require('alpha').setup(require('alpha.themes.dashboard').config)
They are passing pre-defined settings to setup; getting those settings from a theme module.
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.
It is the same usage, the theme option is being converted here:
nixvim/plugins/by-name/alpha/default.nix
Lines 196 to 201 in c83415c
apply = | |
value: | |
if builtins.isString value then | |
lib.nixvim.mkRaw ''require("alpha.themes.${value}").config'' | |
else | |
value; |
c83415c
to
3ea66f1
Compare
cbddcc4
to
0337a66
Compare
0337a66
to
03a6663
Compare
No description provided.