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

feat: allow strings for pluginSpec config via mkLuaInline #5

Conversation

nekowinston
Copy link
Contributor

@nekowinston nekowinston commented Mar 12, 2024

Just occurred to me that toLua allows us to use mkLuaInline for short configs:

   vim-dadbod-ui = {
     src = srcs.vim-dadbod-ui;
-    # TODO: config file with:
-    # vim.g.db_ui_use_nerd_fonts = true
-    # vim.g.db_ui_win_position = "right"
+    config = lib.generators.mkLuaInline ''
+      function()
+        vim.g.db_ui_use_nerd_fonts = true
+        vim.g.db_ui_win_position = "right"
+      end
+    '';
   };

I'm not sure if the current isLuaInline is optimal? Sadly, generators.nix doesn't export it (and also expects an attrset, so it fails when encountering paths).


Alternatively, we could also allow string types and then call mkLuaInline in {isString attrs.config) {...}?

@willruggiano
Copy link
Owner

Probably just use strings, and then call mkLuaInline internally as you say

@nekowinston nekowinston force-pushed the feat/allow-mkLuaInline-in-plugin-config branch from 9b0e4ad to b05b3cc Compare March 12, 2024 20:50
@nekowinston nekowinston changed the title feat: allow mkLuaInline in plugin config feat: allow strings for pluginSpec config via mkLuaInline Mar 12, 2024
@willruggiano willruggiano merged commit 382ede2 into willruggiano:main Mar 12, 2024
1 check passed
@nekowinston nekowinston deleted the feat/allow-mkLuaInline-in-plugin-config branch October 7, 2024 22:37
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