nushell: enable automatic plugins registration#254250
nushell: enable automatic plugins registration#254250viraptor wants to merge 1 commit intoNixOS:masterfrom
Conversation
Nushell requires explicit plugin registration which ends up saved in a specific file. This doesn't work great in the nixpkgs model, so as a workaround, create a wrapper package which prepends a nushell flag for the plugin configuration. The configuration is generated at build time. Pros: included plugins work Cons: can't register extra plugins at runtime
|
@happysalada What do you think about this approach? An alternative is to add a |
|
using home-manager, you can do something like if that is unrelated to the problem you are describing, could you give an example of your problem ? |
|
I'm mostly interested in keeping the versions consistent. You can only use homemanager config for your main/default shell, but when you're trying to develop something and juggle versions (or even run two different ones at the same time) that falls apart, because you need two different configs. |
|
I'm still not sure I see your use case. Could we add some kind of comment as to why this was added (above the section), just for our future selves. However it doesn't affect anyone if they don't use the plugins array. let me get just another set of eyes on this one. |
|
Is this ready to merge? |
I started with previous version of nushell. Now after an update, I get: Even though the new plugins are installed. |
|
a good use case for me is that i can put this in a flake repo when i have scripts that depend on a plugin |
Description of changes
Nushell requires explicit plugin registration which ends up saved in a specific file. This doesn't work great in the nixpkgs model, so as a workaround, create a wrapper package which prepends a nushell flag for the plugin configuration. The configuration is generated at build time.
Pros: included plugins work
Cons: can't register extra plugins at runtime (unless you remove plugins from the arguments or override
--plugin-config)Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)