-
-
Notifications
You must be signed in to change notification settings - Fork 15k
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
[RFC] Proposal: Engineering a Common "Plugin" Infrastructure #59344
Comments
If a desirable solution already exists, then other plugin systems listed in the (TODO) aggregation should be migrated to it. |
This post: syntax/semantics/ergonomics I quite like the Under what circumstances should it be considered meaningful to include non-child packages of the rootPackage in the list? Are there conditions where it's useful to pass in external packages? Say, something like This should not be the same as accepting out-of-tree plugins; I think it would be reasonable to accept something like functions in the plugin list, where during evaluation the root package is applied to the plugins if necessary, and passed on to another builder (or some similar approach). Alternatively, external overrides should be applied strictly through some pattern like the following: |
Per suggestions I have attempted to explore |
Some quick additional notes before I forget, though I don't have much time to elaborate right now:
|
Packages managed by the package managers of (at least interpreted) languages, like Ruby gems, are also plugins, right? |
More: Jekyll has plugins, if I recall correctly. |
@joepie91 2 ) My knee-jerk reaction is that applications need to support application-external plugin/setting management if we don't want strange things to happen? The reason I mention settings management, is because that's usually how plugins get added to the "current set of running plugins", right? My mental model is currently based off of firefox - for which I'm not sure of the details (but there's this mess of notes nix-community/home-manager#606 ) - which is to say, I think (?) I'm agreeing with you. 1 ) 3 ) @eighal yeah I'm inclined to think so. My current heuristic for "plugins" is whether there is some central thing that needs to have plugins fed back into it, that being the interpreter/'s package environment. Misc: Edit: |
TL;DR: if it has something that looks like a |
The |
Projects with internal package managers for handling plugins I've worked with: As @deliciouslytyped mentions: applications themselves need some consideration to prevent bad things happening. EG: in |
I noticed the question mark next to jenkins and decided to dig in a bit mroe.
I agree this puts jenkins in a different group than the above. |
Addition: KDE has a plugin manager as well, for "plasma widgets" and such, I believe. Edit: and Thunar has file manager plugins too, though no interactive manager I think - the Thunar package in nixpkgs also already has a plugins option. |
@coreyoconnor The reason I "separated" it was because on a cursory look I didn't see an implementation of handling plugins - hence: "No implementation". If it had an implementation I would have listed it under the rest. (This is just a comment on that and not really addressing anything else.) Edit: which is to say, it has plugins, there is just no implementation of handling them in nixpkgs. Though now that I think about it, the list might get really long if we start considering everything everywhere that takes plugins. :P - which doesn't mean that I think we shouldn't consider everything. However, I guess after the first 20 or 30 examples it will be time to start trying to figure out archetypes. |
I'm currently poking around overlays and...that stuff. Still trying to figure out how it works. https://www.youtube.com/watch?v=W85mF1zWA2o (@nbp NixCon talk on overlays) is helpful. |
I have a preliminary system for Ghidra I will try upstreaming soon, otherwise I'm still exploring the problem space. |
Possibly related NixOS/rfcs#3 |
Just noticed another item which might be of interest. |
Misc wishlist: It would be nice if Edit: Currently what I'm doing for plugin sets is merging a |
Forgot to link my WIP POC: #60664 |
I turned it into a WIP library https://github.com/deliciouslytyped/nix-rootedoverlay/ , it's pretty broken right now. Help wanted. Edit: I think I fixed stuff but I'm still trying to write tests. |
As a new data point I found that For example plugins classified as |
Where can I find the moodle stuff? From the perspective of my WIP rootedoverlay stuff:
Does that sound reasonable? |
@deliciouslytyped I was mostly just providing another data point... but yes, the second point sounds good 😄 |
All good, thanks :D |
I'm currently working on a POC for the R package set. |
There's a somewhat broken implementation at https://github.com/deliciouslytyped/nix-rer/ currently.
but it seems to basically work. Edit:
|
@barakber I'm thinking of writing a library set for Prolog. I'm not yet familiar with how prolog libraries work, can you maybe explain a bit how
|
I'm currently working on porting the Idris infrastructure. |
Sure. |
It seems like a good idea to read through and steal some ideas from https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/python.section.md , there appear to have been developments since I last read it. (edit: it's more likely that I just didn't notice a bunch of things...) |
TODO: read through https://discourse.nixos.org/t/scaling-the-python-package-set-in-nixpkgs/3749/ , evaluate relevance in both directions, steal ideas |
TODO: look at whats going on in #53834 (comment) |
I marked this as stale due to inactivity. → More info |
This discussion seems very relevant: Status of lang2nix approaches |
If that's relevant, the dream2nix project may be as well. |
Edit: It may be easier to start by looking at https://discourse.nixos.org/t/wip-rfc-a-new-nixpkgs-frontend-for-language-infrastructures/3447
Edit: I made a WIP PoC library https://github.com/deliciouslytyped/nix-rootedoverlay/ , it still needs a lot of work but seems to be functional.
Edit: Help wanted: someone to hand-hold me through the fixpoint stuff needed for overrides in this infrastructureI think I figured it out.There are various separate, probably incompatible implementations of plugin infrastructure across nixpkgs, examples being at least:
(NOT REVIEWED indicates the author is tentatively aware of a plugin system but has not inspected the implementation)
No implementation:
CONSIDER: asking maintainers of the various systems for input
The more advanced implementations usually (TODO: substantiate this) use some kind of fix-point mechanism which can be quite hard to understand.
Would it be possible and reasonable to factor out a plugin handling API that can be specialized to various desired implementations, such that the internal mechanisms do not need to be understood by the user? This could also result in the overall simplification of these components of nixpkgs.
A generic plugin system should:
{..., plugins ? ... }: mkDerivation ...
symlinkJoin
.This has the advantage of being faster and less wasteful than rebuilding the base package, but may fail with improper symlink handling? This also may have other failure modes such as runner makeWrapper scripts referring to the original derivation, resulting in the plugins being ignored because they are in a new derivation. (TODO: elaborate on this, this is an issue I ran into.)
Pending questions:
The text was updated successfully, but these errors were encountered: