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

plugins/alpha: migrate to mkNeovimPlugin #3040

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

HeitorAugustoLN
Copy link
Member

No description provided.

Comment on lines 233 to 235
plugins.alpha.luaConfig.content =
optionalString themeDefined "require('alpha').setup(${toLuaObject cfg.theme})\n"
+ "require('alpha.term')";
Copy link
Member

@MattSturgeon MattSturgeon Feb 27, 2025

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.

Copy link
Member Author

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

Copy link
Member

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:

  1. settings as a whole must not be used when a theme is defined
  2. setup must always be called manually, either passing it settings or theme

Copy link
Member

@MattSturgeon MattSturgeon Feb 27, 2025

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.

Copy link
Member Author

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:

apply =
value:
if builtins.isString value then
lib.nixvim.mkRaw ''require("alpha.themes.${value}").config''
else
value;

@HeitorAugustoLN HeitorAugustoLN force-pushed the alpha-mkneovimplug branch 2 times, most recently from c83415c to 3ea66f1 Compare February 27, 2025 23:11
@HeitorAugustoLN HeitorAugustoLN force-pushed the alpha-mkneovimplug branch 2 times, most recently from cbddcc4 to 0337a66 Compare February 28, 2025 19:14
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

Successfully merging this pull request may close these issues.

2 participants