[Nix#9440] RFC: Nix version-specific plugin config #97

Closed
opened 2024-03-16 06:44:53 +00:00 by lix-bot · 1 comment
Member

Upstream-Issue: NixOS/nix#9440

Is your feature request related to a problem? Please describe.
I'm a user of nix-plugins, which are a way for me to include parts of my dotfiles from out-of-tree (so those parts don't have to be included in my public git repo). Unfortunately, this means I'm limited to exactly one version of Nix at a time, any other version breaks because plugin-files points to a Nix version-specific plugin file. It adds a heavy maintenance burden, as I must now send patches for bumping Nix version upstream to every package that hasn't yet updated; maintaining multiple nix-plugins builds is a much more manageable solution.

Describe the solution you'd like
I'd like to be able to include multiple plugin files in the config, so different versions know to load different files. The syntax could be 2.18:/path/to/plugin1.so 2.17:/path/to/plugin2.so, or anything else (e.g. using the plugin-files-${version} key). Plugins are Nix version-specific anyway, unlike the other config options, so it makes sense for it to be that way.

Describe alternatives you've considered

  • There could be version-specific config files, for example nix.conf.d/2.18.conf.
  • Allowing plugin-files to be overridden at runtime, with nix-daemon forking to support it?
  • Another way for flakes to load secret Nix code from outside their tree could be added (besides --impure of course). For example, a way to whitelist a hardcoded absolute path, --option impure-paths ..., or an option to allow using NIX_PATH.

Additional context
Add any other context or screenshots about the feature request here.

Priorities

Add 👍 to issues you find important.

Upstream-Issue: https://git.lix.systems/NixOS/nix/issues/9440 **Is your feature request related to a problem? Please describe.** I'm a user of [nix-plugins](https://github.com/shlevy/nix-plugins), which are a way for me to include parts of my dotfiles from out-of-tree (so those parts don't have to be included in my public git repo). Unfortunately, this means I'm limited to exactly one version of Nix at a time, any other version breaks because `plugin-files` points to a Nix version-specific plugin file. It adds a heavy maintenance burden, as I must now send patches for bumping Nix version upstream to every package that hasn't yet updated; maintaining multiple `nix-plugins` builds is a much more manageable solution. **Describe the solution you'd like** I'd like to be able to include multiple plugin files in the config, so different versions know to load different files. The syntax could be `2.18:/path/to/plugin1.so 2.17:/path/to/plugin2.so`, or anything else (e.g. using the `plugin-files-${version}` key). Plugins are Nix version-specific anyway, unlike the other config options, so it makes sense for it to be that way. **Describe alternatives you've considered** - There could be version-specific config files, for example `nix.conf.d/2.18.conf`. - Allowing `plugin-files` to be overridden at runtime, with nix-daemon forking to support it? - Another way for flakes to load secret Nix code from outside their tree could be added (besides `--impure` of course). For example, a way to whitelist a hardcoded absolute path, `--option impure-paths ...`, or an option to allow using `NIX_PATH`. **Additional context** Add any other context or screenshots about the feature request here. **Priorities** Add :+1: to [issues you find important](https://github.com/NixOS/nix/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc).
lix-bot added the
imported
label 2024-03-16 06:44:53 +00:00
Owner

Since https://gerrit.lix.systems/c/lix/+/490 there is a lot less pain for this use case, since the plugins will simply cleanly fail to load without stopping the process. Also, if one is as good as the nix-doc plugin, one can even prevent oneself from failing to load by version checking the nix being loaded into!

I'm going to close this because it doesn't seem like a very high priority.

(also this is just. flake problems, which can be solved with --impure, which is totally safe and fine tbh)

Since https://gerrit.lix.systems/c/lix/+/490 there is a lot less pain for this use case, since the plugins will simply cleanly fail to load without stopping the process. Also, if one is as good as the nix-doc plugin, one can even prevent oneself from failing to load by version checking the nix being loaded into! I'm going to close this because it doesn't seem like a very high priority. (also this is just. flake problems, which can be solved with `--impure`, which is totally safe and fine tbh)
jade closed this issue 2024-04-08 03:52:22 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#97
No description provided.