Add Nix flake packaging - #23
Merged
Merged
Conversation
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
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.
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.