Repository navigation
feat(packaging): let store-based packages provide the desktop integrations - #1975
Merged
Merged
Conversation
…tions Add the STRATA_INTEGRATIONS=package build switch. With it set, the file chooser portal, FileManager1 service, Omarchy shortcut, and udiskie unlock installers refuse from Settings and the command line, the start-up stale portal refresh is skipped, and the two Settings rows explain that the package provides the integration. The Nix package builds that way and exposes fileChooserPortal and fileManagerService derivations whose Exec lines point at the package wrapper, so updates, rollbacks, and garbage collection keep them in sync.
This was referenced Nov 1, 2026
4 of 13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
On Nix,
wrapGAppsHook4makesbin/strataa wrapper aroundbin/.strata-wrapped, and every store path changes on update. The runtime installers record/proc/self/exe, so the file chooser portal, FileManager1 service, Omarchy shortcuts, and udiskie hook end up pointing at the wrapped binary of one build: D-Bus-activated instances skip the wrapper's environment, and the next update or garbage collection leaves the files stale.This adds the
STRATA_INTEGRATIONS=packagebuild switch (runtimeis the default; any other value fails the build, likeSTRATA_UPDATER). With it set:portal_setup::install/uninstall/install_file_manager/uninstall_file_manager/dismiss_promptandudiskie::install/uninstallreturn a translated refusal, so--install-portal,--uninstall-portal,--dismiss-portal-prompt,--install-udiskie-unlock, and--uninstall-udiskie-unlockexit non-zero with that message, and Settings cannot trigger them.refresh_stale_portal()and the post-update portal refresh are no-ops.The Nix package builds with the switch and gains two passthru derivations,
fileChooserPortal(strata.portalplus its D-Bus service) andfileManagerService(theorg.freedesktop.FileManager1service), each withExecpointing at${strata}/bin/strata. They are separate from$outon purpose: NixOS registers every system package'sshare/dbus-1/serviceswith the session bus, so shipping the FileManager1 service in the main package would make every install claim the bus name.nix flake checkbuilds both. The README shows the NixOSxdg.portal.extraPortals/xdg.portal.config/services.dbus.packagesoptions and the Home Managerxdg.mimeAppsandservices.udiskie.settingsequivalents;docs/packaging.mddocuments the switch.Paths reviewed and intentionally left alone, per the issue:
update_install.rs(desktop entry and icon cache refresh) is only reached through the in-place updater, whichSTRATA_UPDATER=disabledalready compiles out.xdg-mime defaultfolder association stores only the desktop ID and stays per-user; Home Manager users setxdg.mimeApps.defaultApplications.PackageManager::detect()returnsNoneon NixOS, so Settings → Integrations and Diagnostics show requirement chips without an install command, which is correct there. A Nix-specific hint is not part of this change.--portal,--gapplication-service, and--udiskie-hook, which the shipped files invoke, are unchanged.Visual evidence
N/A. The only visible change is in
STRATA_INTEGRATIONS=packagebuilds: the two Desktop integration rows show a title and a one-paragraph note instead of status indicators and the Complete setup / Restore default / Use Strata buttons.How to test
STRATA_INTEGRATIONS=package cargo run -- --install-portaland... --install-udiskie-unlock: both print the refusal and exit 1 without writing under~/.configor~/.local/share.STRATA_INTEGRATIONS=package cargo run, open Settings → General, scroll to Desktop integration: both rows show the package note and no buttons; search for "desktop integration" still finds the row.cargo run) behaves as before: indicators, Complete setup and Restore default.nix build .#strata.fileChooserPortal .#strata.fileManagerServiceand inspectresult*/share; theExeclines point at/nix/store/…-strata-<version>/bin/strata, not.strata-wrapped.nix flake checkpasses.Expected result: package builds never write, remove, or refresh the integration files; the Nix derivations provide them, pointing at the wrapper.
Validation run locally:
./scripts/test-headless.py -- ui::portal_preferences::tests ui::udiskie_preferences::tests portal_setup::tests i18n:: build_info::(47 passed, 1 pre-existing ignored),cargo fmt --check,cargo clippy --locked --all-targets --all-features -- -D warnings, and in anixos/nixcontainer:nix flake check --all-systems --no-build,nixfmt --check flake.nix package.nix, a fullnix buildof the package and both derivations, and the built binary's--install-portal/--install-udiskie-unlockrefusals.Related issue
Closes #1969