Skip to content

Add desktop app library path override and NixOS profile locations - #291

Open
fabiob wants to merge 1 commit into
1Password:mainfrom
fabiob:desktop-lib-path-override
Open

fabiob wants to merge 1 commit into
1Password:mainfrom
fabiob:desktop-lib-path-override

Conversation

@fabiob

@fabiob fabiob commented Oct 17, 2026

Copy link
Copy Markdown

What

  • New env var OP_DESKTOP_APP_LIB_PATH: when set, it is tried first for the desktop app shared library (libop_sdk_ipc_client.so/.dylib/.dll), falling back to the standard locations if the path doesn't exist.
  • On Linux, three additional locations are searched:
    • /run/current-system/sw/share/1password/libop_sdk_ipc_client.so (NixOS system profile — stable across app upgrades)
    • ~/.nix-profile/share/1password/libop_sdk_ipc_client.so
    • ~/.local/state/nix/profile/share/1password/libop_sdk_ipc_client.so

Why

On NixOS the 1Password desktop app lives under a content-addressed store path, so none of the hardcoded FHS locations (/usr/bin/1password, /opt/1Password, /snap/bin/1password) exist. Every SDK consumer that authenticates through the desktop app fails with:

SDK client creation with desktop integration failed: 1Password desktop application not found

even though the app is running, unlocked, and has Settings → Developer → Integrate with other apps enabled. The library itself exists in the package (/nix/store/<hash>-1password-<version>/share/1password/libop_sdk_ipc_client.so, symlinked from /run/current-system/sw/share/1password/ for system installs).

This hits the Terraform provider (terraform-provider-onepassword, which vendors this SDK) and anything else built on the SDK running on NixOS. The workaround today is a manual symlink into /opt/1Password.

Testing

  • New unit test TestDesktopLibLocations covers the override priority, the default Linux list (including the NixOS system profile path) and the unsupported-OS error path: go test ./internal/ -run TestDesktopLibLocations ✅
  • go build ./... and go vet ./internal/ ✅
  • Paths verified on NixOS 26.11 with 1Password 8.12.38 installed as a system package (the /run/current-system/sw/share/1password/... path exists and resolves to the store lib).

The SDK locates the desktop app shared library (libop_sdk_ipc_client.so)
at hardcoded FHS paths (/usr/bin/1password, /opt/1Password,
/snap/bin/1password). On NixOS the desktop app lives under a
content-addressed store path, so none of those exist and SDK clients fail
with "SDK client creation with desktop integration failed: 1Password
desktop application not found" even when the app is running, unlocked and
has "Integrate with other apps" enabled.

- Try $OP_DESKTOP_APP_LIB_PATH first when set (falls back to the standard
  locations if it doesn't exist).
- On Linux, also look in the NixOS system profile
  (/run/current-system/sw/share/1password) and the Nix user profiles
  (~/.nix-profile, ~/.local/state/nix/profile).

Behavior for the supported platforms is otherwise unchanged.

Signed-off-by: Fabio Batista <fabio@atelie.dev.br>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant