Skip to content

Add Nix flake packaging - #23

Merged
occamist merged 5 commits into
mainfrom
add-nix-flake
Aug 15, 2026
Merged

Add Nix flake packaging#23
occamist merged 5 commits into
mainfrom
add-nix-flake

Conversation

@occamist

Copy link
Copy Markdown
Owner

Adds flake.nix + nix/package.nix (buildRustPackage + cargo-tauri.hook + pnpm frontend deps) so the app can be built/installed via Nix, mirroring areofyl/fetch's flake layout. Patches libappindicator-sys's runtime dlopen of libayatana-appindicator3.so.1 and its libappindicator3.so.1 fallback to absolute Nix store paths, since bare sonames don't resolve in the sandbox.

occamist and others added 5 commits August 15, 2026 05:44
Adds flake.nix + nix/package.nix (buildRustPackage + cargo-tauri.hook +
pnpm frontend deps) so the app can be built/installed via Nix, mirroring
areofyl/fetch's flake layout. Patches libappindicator-sys's runtime
dlopen of libayatana-appindicator3.so.1 and its libappindicator3.so.1
fallback to absolute Nix store paths, since bare sonames don't resolve
in the sandbox.
Fix a real breakage first: switching to cargoLock.lockFile moved the
vendor dir from the nested fetchCargoVendor layout to importCargoLock's
flat one, so the libappindicator-sys glob silently stopped matching. The
build still succeeded and would only have failed at runtime, when the
tray icon tried to dlopen a bare soname. postPatch now matches both
layouts and aborts if it patches nothing.

Also:

- Drop the isLinux conditionals. meta.platforms is linux-only and the
  flake exports no darwin systems, so they were always true; stdenv is
  no longer needed as an argument.
- Remove preBuild. tauri.conf.json's beforeBuildCommand already runs
  pnpm build during cargo-tauri.hook's build phase, so the frontend was
  being built twice.
- Drop openssl. No openssl-sys in Cargo.lock, and nothing in the built
  closure references it.
- Narrow src and pnpmDeps.src with lib.fileset. Docs and packaging files
  no longer invalidate the build, and the dependency fetch reruns only
  when the lockfile actually changes. pnpmDeps.hash is unchanged --
  verified by forcing a refetch.
- Scope updateHashesScript's rewrites to the matched line number and
  require exactly one hash attribute. The old substitution matched the
  hash text anywhere in the file, including inside comments and its own
  embedded source. Add git to runtimeInputs; it was relying on the
  caller's PATH.
- Add checks and .github/workflows/nix.yaml, building against both the
  locked nixpkgs and nixos-26.05. Consumers pin us to stable via
  inputs.nixpkgs.follows, which can resolve a different pnpm than the one
  pnpmDeps.hash was computed against; today both produce the same hash,
  and CI is what keeps that true.
- Document why doCheck is off, and set meta.maintainers.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Et1JWuNe3VqzfqWhyJGm3L
@occamist
occamist merged commit 94ce11f into main Aug 15, 2026
1 check passed
@occamist
occamist deleted the add-nix-flake branch August 15, 2026 07:24
occamist added a commit that referenced this pull request Aug 24, 2026
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