Issues with managing plugins on NixOS with Home Manager #668
-
I use NixOS and I am trying to manage Strangely, it also appears that the first plugin gets loaded, even if I do not require it or run its setup function in Also, since there are currently no packages for xplr plugins, I declare the plugins' repositories as inputs to my config flake and it is these that I put in Am I doing something wrong? I have only recently started using My xplr config: { inputs, ... }: {
programs.xplr = {
enable = true;
plugins = [
inputs."icons.xplr"
inputs."extra-icons.xplr"
inputs."tri-pane.xplr"
];
extraConfig =
#lua
''
require("icons").setup()
require("extra-icons").setup()
require("tri-pane").setup()
'';
};
} The relevant flake.nix inputs "tri-pane.xplr" = {
url = "github:sayanarijit/tri-pane.xplr";
flake = false;
};
"icons.xplr" = {
url = "github:Ashvith10/icons.xplr/fix-nerd-fonts-v3.0.0-changes";
flake = false;
};
"extra-icons.xplr" = {
url = "github:dtomvan/extra-icons.xplr";
flake = false;
}; |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 37 replies
-
Hi! I am encountering the same issue as you are (at least I think I am anyway). I am not managing my plugins with flake inputs (yet), but the issue that you described of "only the first plugin gets picked up" still applies to me anyway. The home-manager module for xplr sets the pluginPath = if cfg.plugins != [ ] then
(''
package.path=
'' + (concatStringsSep " ..\n"
(map (p: ''"${p}/init.lua;${p}/?.lua;"'') cfg.plugins)) + ''
..
package.path
'')
else
"\n"; Like you, I do not have a wealth of experience with lua, but have found myself at the conclusion that the module is at fault; it seems incorrect to have a component of
The first part of the map in the HM module creates As an example: With the following directory structure:
Where package.path="./plugin-1/init.lua;./plugin-2/init.lua"..package.path
require "plugin-1".setup()
require "plugin-2".setup() and local function setup()
print("hello from plugin <1 or 2>")
end
return { setup = setup } Invoking
Thus seeming to confirm my impression that the current HM module setup results in one of the plugin's I spent a considerable amount of time thinking about how this could be fixed, and I think I might have a winning idea. Instead of the HM module setting the To illustrate, in the lua interpreter using the example directory and code from above:
So, as long as we can safely make the assumption/assertion that plugins will follow the convention established by upstream (that plugins have an I plan on making the fix and making a PR to home-manager if said fix goes according to plan. [Edit: In light of the above edit, I think this could still be a viable fix, but I think the output of |
Beta Was this translation helpful? Give feedback.
-
[ Edit: this was meant to be a reply to my original comment; my apologies for splitting the discussion! ] @NotAShelf Thanks for hopping in here!
I just tried, and even though
Yes, but issues arise when using those absolute paths to update Lua's @sayanarijit I am having trouble following with the wrapping concept you proposed. Would that necessitate any changes on the |
Beta Was this translation helpful? Give feedback.
-
I had tested the module while working on it, but can't say I've tested with multiple plugins. Probably an oversight on my behalf. My understanding of the problems, however, is that plugins themselves look for certain paths that they cannot resolve as they live in the store. This is aside from the fact that the mapping logic is likely incorrect.
The user doesn't need to know the package path though, no? String interpolation, when used correctly, will automatically point at the correct (parent) path of whatever the plugin is, whether it is a package or input with
I am under the impression that the module already allows for those types with
Thank you for your concern. I'll be taking a much needed rest for the weekend soon enough. |
Beta Was this translation helpful? Give feedback.
See nix-community/home-manager#4520 and nix-community/home-manager#4521