-
-
Notifications
You must be signed in to change notification settings - Fork 165
docs: extend configuring section with details on the module system #1094
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: NotAShelf <[email protected]> Change-Id: I6a6a696449aab94c06827ea4b1d6e6042cc97ee6
Signed-off-by: NotAShelf <[email protected]> Change-Id: I6a6a6964f2e65a11acab2a2f7413a5f94bff3815
| @@ -0,0 +1,58 @@ | |||
| ## Using the Module Interface {#ch-module-interface} | |||
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 feel like this page should be named "configuring supported plugins" or at least something that mentions plugins
|
|
||
| ```nix | ||
| # Notice the position indicator, "@1" | ||
| { "@1" = "foo"; bar = "baz"; }; |
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.
uuuhhh the "@1" syntax was never really exposed, and has been an internal thing thus far. I'd really like to address some problems with the current design before we actually expose them, namely:
- you can't "escape" the @ syntax, i.e. you can't make a lua table like this:
{ ["@1"] = something } - being able to add raw lua expressions as values - this is purely so we can express the lua expr
{ [vim.log.levels.ERROR] = "E" }in nix - I also don't like the random ass
@syntax - I'd rather use something like this: (this is in nix){ "[1]" = something; }. At least this looks like the lua syntax
to that end, I'd like to propose we drop the @ syntax, and use something like this:
# this nix attrset:
{
"[1]" = 1;
"[vim.log.levels.ERROR]" = "E";
''["[example to show how to escape brackets]"]'' = 2;
}
# converts to this lua table:
{
[1] = 1;
[vim.log.levels.ERROR] = "E";
["[example to show how to escape brackets]"] = 2;
}
I'm still a bit iffy on the [...] syntax, but even if we stick to @ I'd rather interpret it as a raw lua expression since it solves 1. and 2.
regardless, both options are breaking changes I should probably put in a separate issue
all this to say, please remove this section until we fix the issues with the current syntax :)
This is an initial draft of a new
modulessection describing how we use the Nix module system within nvf. While it does not cover every module, I think it is worth covering the basics of a module to give the users and idea and to potentially answer questions from those New to the Nix ecosystem.I also think we stand to gain from adding some examples in the DAG section, but I reckon it may be more confusing for the users than it is helpful. CC @horriblename and @Soliprem for reviews and feedback. This can be merged as is, but worth discussing beforehand.
Closes #1067