Let shell plugins declare optional package dependencies #7382
jacob-vincent-mink
started this conversation in
Suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
ai;dr I'm working on a plugin that derives some optional functionality from a browser extension. Today, that functionality is injected into the system via the plugin's settings page (all quickshell jazz), and must be removed using the same settings page. If the user does not do this prior to removing the plugin, it leaves an orphaned browser extension.
Having reviewed some of the intentions behind the plugin system design, I understand the reasons why the plugin add/remove logic does not allow for any hooks - that being said, I hope this proposal for dependencies/optional dependencies can be considered as it will extend the plugin system meaningfully. Allowing
omarchy plugin add/removeto inspect the manifest and handle package dependencies itself, in full view of the user, would help with the use case above. Further iterations with sol brought out an interesting option for auto-generating a meta-package for the plugin on install that seems to help resolve the dependency tracking issue nicely.Enjoy the 5.6 sol write-up below, outline more of the details, tyty.
The gap
Omarchy shell plugins are intentionally simple to install:
The command clones and validates the repository without running installation hooks, invoking a package manager, or requesting elevated privileges. That is a valuable security boundary.
Some plugins may offer capabilities that require packages outside the plugin directory. Examples include:
Today, plugin authors must bundle these dependencies, ask users to install them manually, or implement custom setup and removal flows.
Why checking whether a package is installed is insufficient
Suppose an existing Arch package already depends on grim:
existing-package → grim
A newly enabled Omarchy plugin also needs grim, but the plugin is a Git checkout rather than an Arch package. Pacman cannot see that relationship.
If existing-package is later removed with dependency cleanup, pacman can remove grim even though the plugin still needs it.
Omarchy could maintain its own dependency accounting, but pacman already has a dependency graph. The missing piece is representing the plugin inside that graph.
Proposal
Allow plugin manifests to declare required and optional packages. Omarchy would translate the accepted declarations into a generated, metadata-only Arch metapackage for that plugin.
An illustrative manifest might look like:
After the user selects optional capabilities, Omarchy could generate the equivalent of:
The generated package would contain no executable code or installed files. It would exist only to give pacman a real dependency edge:
existing-package ──────────────────→ grim
omarchy-plugin-deps-example-plugin ─→ grim
Why a metapackage helps
Pacman would retain responsibility for dependency resolution and removal:
This avoids maintaining a second dependency graph inside Omarchy.
Suggested lifecycle
Add
omarchy plugin add would continue to:
It would not install packages simply because the repository was cloned.
Enable
When enabling the plugin, Omarchy would:
omarchy plugin add --enable could perform both phases in one flow.
An example prompt:
This plugin requests:
Required:
grim extra/grim 1.4.1
Optional:
[x] Browser context
example-browser-companion omarchy/example-browser-companion 1.0.0
Install these capabilities? [Install / Cancel]
Disable
Disabling a plugin could retain its metapackage so re-enabling it does not require reinstalling dependencies.
Update
If a plugin update changes its dependency declaration, Omarchy would show that separately from the source diff.
After confirmation, it would regenerate and reinstall the metapackage with the new dependency list. Removed dependencies would then become eligible for pacman's normal orphan handling.
Remove
Plugin removal would:
Pacman would preserve dependencies still required by another package, another plugin metapackage, or an explicit user installation.
Optional capabilities
Optional capabilities could be represented by dependencies included in or omitted from the generated metapackage.
Enabling a capability would regenerate the metapackage with its packages included. Disabling it would regenerate the metapackage without them.
This could support a standard plugin Settings surface while keeping the capability lifecycle under Omarchy and pacman control.
Package sources
A first implementation could allow only packages available through configured pacman repositories, including official Arch repositories and the signed Omarchy repository.
It should not accept:
Support for other sources could be considered separately.
Security properties
The metapackage must be generated entirely by trusted Omarchy code from validated manifest data.
Plugin manifests would provide only package names, supported version constraints, capability labels, and descriptions. They would not provide executable package-building content.
This preserves the current guarantee that adding a plugin does not silently execute installation code while still supporting richer integrations.
Failure and recovery
Open questions
This would let plugins remain small and safe by default while allowing users to enable richer integrations through a native, auditable package lifecycle.
All reactions