fix(nix): build from source instead of wrapping AppImage#778
fix(nix): build from source instead of wrapping AppImage#778cjpais merged 2 commits intocjpais:mainfrom
Conversation
Replace the AppImage-based Nix package with a native from-source build using cargo-tauri.hook + rustPlatform.buildRustPackage. This eliminates the recurring hash mismatch failures when releases update the binary. - Build frontend (bun) and backend (cargo tauri) from source - Vendor JS deps as a fixed-output derivation - Patch libappindicator-sys for Nix store path - Patch ferrous-opencc to skip cbindgen (upstream removed in v0.3.1+) - Wrap binary with WEBKIT_DISABLE_DMABUF_RENDERER and LD_LIBRARY_PATH - Delete update-flake-hash.yml workflow (no longer needed) - devShell unchanged
|
Thanks for this, I'm going to merge it. If there's any other issues we'll continue to fix them as users say. Thank you so much for your contributions! |
pinage404
left a comment
There was a problem hiding this comment.
I confirm, that it works as before =)
| homepage = "https://github.com/cjpais/Handy"; | ||
| license = lib.licenses.mit; | ||
| mainProgram = "handy"; | ||
| platforms = [ "x86_64-linux" ]; |
There was a problem hiding this comment.
supportedSystems is set to [ "x86_64-linux" "aarch64-linux" ]
but this line restricts to only "x86_64-linux"
why ?
| pkg-config | ||
| wrapGAppsHook4 | ||
| bun | ||
| nodejs |
There was a problem hiding this comment.
We don't need NPM
| nodejs | |
| nodejs-slim |
I'm even surprised that Node is needed beside Bun
| ''; | ||
|
|
||
| preBuild = '' | ||
| cp -r ${bunDeps}/node_modules node_modules |
There was a problem hiding this comment.
Maybe Node dependency can be removed with this
| cp -r ${bunDeps}/node_modules node_modules | |
| cp -r ${bunDeps}/node_modules node_modules | |
| substituteInPlace node_modules/.bin/{tsc,vite} \ | |
| --replace-fail "/usr/bin/env node" "${lib.getExe bun}" |
| chmod -R +w node_modules | ||
| patchShebangs node_modules | ||
| export HOME=$TMPDIR | ||
| ${pkgs.bun}/bin/bun run build |
There was a problem hiding this comment.
Bun has been added to nativeBuildInputs maybe the absolute path is not necessary
| ${pkgs.bun}/bin/bun run build | |
| bun run build |
| ${pkgs.bun}/bin/bun run build | ||
| ''; | ||
|
|
||
| doCheck = false; |
There was a problem hiding this comment.
Why are the tests skipped ?
- Replace patchShebangs with targeted substituteInPlace for tsc/vite
shebangs, pointing them to bun instead of node
- Use `bun run build` instead of `${pkgs.bun}/bin/bun run build`
since bun is already in nativeBuildInputs
- Remove nodejs from nativeBuildInputs (no longer needed)
- Add comment explaining why doCheck is disabled
Before Submitting This PR
Please confirm you have done the following:
Human Written Description
I've been happy with the previous implementation but it wasn't robust and there were requests for building from source, so here it is :)
Related Issues/Discussions
Fixes #701
Community Feedback
Issue #701 has multiple users reporting the hash mismatch problem. The maintainer expressed support for a native build approach in the issue comments.
Testing
nix build .#handybuilds from source successfullyresult/bin/handyproduces a working wrapped binary with all resources bundledlddconfirms all shared libraries resolve to Nix store pathsnix developdevShell still works as beforeScreenshots/Videos (if applicable)
N/A
AI Assistance
If AI was used: