packaging(nix): ship desktop as a prebuilt binary (download, no compile)#211
Merged
Conversation
zennotes-desktop now wraps the official prebuilt ZenNotes-<ver>-linux-x64.tar.gz release artifact (fetchurl + autoPatchelfHook + wrapGAppsHook3) instead of building Electron from source via buildNpmPackage. This makes `nix run github:ZenNotes/zennotes` download the same signed binary the AppImage/deb/AUR ship rather than compiling locally — the most-requested Nix ask. The tarball sha256 is pinned as release-data.json `desktopHash`. - package-desktop.nix: rewritten as a binaryNativeCode repackage; drops the SUID chrome-sandbox so Electron uses the userns sandbox; installs icons + desktop entry from the tarball's arch-extras tree. - release-data.json: add desktopHash (server still builds from source, so hash/npmDepsHash/vendorHash stay). - flake.nix: desktop is x86_64-linux only now (prebuilt x64); server is the default elsewhere, keeping eval clean on darwin/aarch64. - nix-build.yml: CI builds both packages on Nix-packaging changes (we have no local Nix machine to verify on).
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.
The most-requested Nix ask: make
nix run github:ZenNotes/zennotesdownload the app instead of compiling Electron from source.This rewrites
zennotes-desktopto wrap the official prebuiltZenNotes-<ver>-linux-x64.tar.gzrelease artifact (fetchurl+autoPatchelfHook+wrapGAppsHook3) — the same approach the AUR and Flatpak packages use, and how nixpkgs packages prebuilt Electron apps (Slack/Discord). No Cachix/binary-cache account needed; the prebuilt binary is the download.Changes
package-desktop.nix— prebuilt repackage (sourceProvenance = binaryNativeCode). Drops the SUIDchrome-sandbox(can't be setuid in the Nix store → Electron uses the userns sandbox, same as the Flatpak); installs icons +.desktopfrom the tarball'sarch-extrastree.release-data.json— addsdesktopHash(the tarball sha256,sha256-Y+l/bhP…, matching the AUR63e97f…). The server still builds from source, sohash/npmDepsHash/vendorHashstay.flake.nix—zennotes-desktopis now x86_64-linux only (prebuilt x64); the server is the default on other systems so eval stays clean on darwin/aarch64.nix-build.yml— CI builds both packages on any Nix-packaging change (we have no local Nix machine, so CI is the verification).Verification
The
Nix buildcheck on this PR runsnix build .#zennotes-desktop .#zennotes-server. Merging only after it's green. (Runtime launch can't be tested without a NixOS box — same constraint under which the AppImage/deb/AUR/Flatpak shipped — but the lib set mirrors nixpkgs' proven prebuilt-Electron packaging.)Trade-off
Loses the from-source build (x64-linux gets the official binary instead). The server remains from-source.