feat(nix): add flake for the standalone Linux binary - #1686
Merged
Conversation
Open
manuc66
force-pushed
the
feat/nix-package
branch
from
September 7, 2026 21:16
96aeb00 to
5072c7a
Compare
Co-authored-by: Junie <junie@jetbrains.com>
manuc66
force-pushed
the
feat/nix-package
branch
from
September 7, 2026 21:35
5072c7a to
d6b571c
Compare
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.
What
Adds a Nix flake so the standalone Linux binaries shipped since v1.11.0 can be used directly from the repository:
flake.nixexposespackages.default/packages.node-hp-scan-toandapps.defaultforx86_64-linuxandaarch64-linux; the version is read frompackage.json.packaging/nix/package.nixdownloads the releasedlinux-x64/linux-arm64tarball, installs the binary plus the default config (NODE_CONFIG_DIR) and docs, and keeps the binary byte-identical.Why the launcher
Two properties of the bun-compiled binary drive the packaging:
strip, which nixpkgs runs by default on$out/lib, orpatchelf) silently destroys the app bundle bun appends to the executable — the binary then degrades to a plainbunCLI. The derivation therefore setsdontStrip = trueand never patches it./lib64/ld-linux-x86-64.so.2, which does not exist on NixOS. Instead of patching, the wrapper runs the binary through the nixpkgs glibc loader (ld-linux-* --library-path …), which needs noprograms.nix-ldand no FHS environment.Automating Nix Hashes
To ensure
nix runworks immediately after a release (without the hashes being "one version behind"), the release process has been updated:Releaseworkflow (or locally viarelease.sh).scripts/update-nix-hashes.shcalculates the SRI hashes of these binaries and updatespackaging/nix/package.nixbefore the version commit and tag.Releaseworkflow to thePublishworkflow via GitHub artifacts. This ensures the hashes committed to Git match the final assets bit-for-bit, despitebun build --compilebeing non-deterministic.Evidence (already verified, in a Nix 2.35 container)
nix flake check --all-systemsall checks passed!(x86_64 + aarch64, packages + apps)nix build .#defaultnix run .# -- single-scan --helpnix run .# -- discover --jsonNo HP scan-capable device foundin the container, expected)nix profile install .#default+ rund4bb2766…matches the release tarball binaryNODE_CONFIG_DIRresolved)Checklist
Done:
nix flake check --all-systemspassesx86_64-linuxnix runandnix profile installNODE_CONFIG_DIRTo do / not yet verified:
aarch64-linuxrealization (derivation evaluated only, no aarch64 builder/emulation here)single-scan/listen/adf-autoscan/discover)