Skip to content

Conversation

@NotAShelf
Copy link
Owner

@NotAShelf NotAShelf commented Aug 21, 2025

This is an initial draft of a new modules section 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

Signed-off-by: NotAShelf <[email protected]>
Change-Id: I6a6a696449aab94c06827ea4b1d6e6042cc97ee6
Signed-off-by: NotAShelf <[email protected]>
Change-Id: I6a6a6964f2e65a11acab2a2f7413a5f94bff3815
github-actions bot pushed a commit that referenced this pull request Aug 21, 2025
@github-actions
Copy link

🚀 Live preview deployed from 0383311

View it here:

Debug Information

Triggered by: NotAShelf

HEAD at: notashelf/push-kxltupyypnpo

Reruns: 1267

@@ -0,0 +1,58 @@
## Using the Module Interface {#ch-module-interface}
Copy link
Collaborator

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"; };
Copy link
Collaborator

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:

  1. you can't "escape" the @ syntax, i.e. you can't make a lua table like this: { ["@1"] = something }
  2. 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
  3. 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 :)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

utility/oil-nvim: key-value pair

3 participants