Skip to content

CD: daily workflow to sync binary package checksum for Nix. - #12

Open
Endermanbugzjfc wants to merge 14 commits into
alvesvaren:mainfrom
Endermanbugzjfc:Endermanbugzjfc-nix-binary
Open

Endermanbugzjfc wants to merge 14 commits into
alvesvaren:mainfrom
Endermanbugzjfc:Endermanbugzjfc-nix-binary

Conversation

@Endermanbugzjfc

@Endermanbugzjfc Endermanbugzjfc commented Sep 1, 2026 •

Copy link
Copy Markdown

Background

This pull request adds a GitHub workflow that syncs the binary package checksum of the latest tagged release from a tag-bin branch daily.

With the content added in #10, the Nix package manager can build rm-pad from source. However, as Nix requires a hash for online downloads, the prebuilt binary package is not easily accessible with Nix despite the Release workflow uploading artefacts to every release.

Changes

  • Blocked by: Dev Exp: Nix development shell and package. #10

  • A workflow has been added that runs every 24 hours to update (or create) the tag-bin branch to set the hash of the binary, corresponding to the latest tagged release. Note: the workflow will create a tag-bin branch if it does not exist. It might require to be manually enabled after merging this PR.

  • A comment has been added in flake.nix mentioning the binary package.

  • README.md now mentions the tag-bin branch.

  • The rm-pad-bin package is exported in flake.nix, an assertion error will appear if a non-x86_64-linux machine tries to use this package.

Live tests

Tests require merging the pull request, as the tag-bin branch doesn't exist yet.

Alternative tests are done against https://github.com/Endermanbugzjfc/rm-pad/tree/tag-bin on the following environments:

A

CPU Architecture: x86_64
OS: NixOS 26.11

Desktop Environments:

  • Hyprland 0.56.0
  • KDE Plasma 6.7.3 (Wayland)

reMarkable: reMarkable 2 version 3.27.3.0

B

CPU Architecture: x86_64
OS: Arch Linux (Lix package manager)

Desktop Environments:

  • Hyprland 0.56.0
  • KDE Plasma 6.7.3 (Wayland)

reMarkable: reMarkable 2 version 3.27.3.0

Ezjfc and others added 8 commits July 27, 2026 10:11
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Expose two flake packages alongside the dev shell:

- rm-pad: built from source with buildRustPackage
- rm-pad-bin: the x86_64 release tarball for the closest git tag reachable
  from HEAD, with the hash taken from the release .sha256 so the download
  stays a reproducible fixed-output derivation. Fails explicitly when a tag
  ships no binary. Needs `nix build .#rm-pad-bin --impure` from the repo root.

Extract the shared cross-compilers and linked libraries into nix/common.nix,
consumed by shell.nix and both packages.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Drop the impure rm-pad-bin package (and its flake export) from this branch.
The prebuilt binary now lives on the auto-updated tag-bin branch, which pins
the release artefact so it works purely and remotely. README points there:

    nix run github:Endermanbugzjfc/rm-pad/tag-bin

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Make the source package equivalent to the Arch and -bin packages by also
installing the udev rule, systemd user unit, and example config, so a future
NixOS module can use `systemd.packages = [ rm-pad ]`.

Set version to the full commit hash (self.rev) instead of the stale Cargo.toml
version. Resolved purely from flake source info; falls back to <sha>-dirty on a
dirty tree and to the Cargo.toml version outside a flake.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Commented out the rm-pad-bin package definition in flake.nix.
Co-authored-by: EndermanbugZJFC <53002741+Endermanbugzjfc@users.noreply.github.com>
Endermanbugzjfc and others added 5 commits September 2, 2026 02:51
Update README to reflect new repository URL for tag-bin.
This Nix expression defines the package for rm-pad-bin, including its dependencies, build instructions, and metadata.
Drop the duplicated runtime library list from package-bin.nix and pull
it from the shared common.nix module, matching how package.nix already
consumes it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NVqea1jE1MetumeJXou4Dc
Add onTagBinBranch to common.nix (detects nix/bin-lock.json, which only
exists on the tag-bin branch) and guard each package with an assertMsg:
package.nix refuses to build from source on tag-bin, and package-bin.nix
refuses to build off tag-bin, each pointing users at the right branch.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NVqea1jE1MetumeJXou4Dc
@Endermanbugzjfc
Endermanbugzjfc deleted the Endermanbugzjfc-nix-binary branch September 4, 2026 06:58
@Endermanbugzjfc
Endermanbugzjfc restored the Endermanbugzjfc-nix-binary branch September 4, 2026 06:58
@Endermanbugzjfc

Copy link
Copy Markdown
Author

Accident.

Consolidate the tag-bin/main branch guards in flake.nix instead of the
individual package expressions. rm-pad-bin is now a real package output:
its assertion runs first and only then is nix/bin-lock.json read, so the
lock file is never touched off the tag-bin branch. default resolves to
rm-pad-bin on tag-bin, else the source rm-pad.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NVqea1jE1MetumeJXou4Dc
@Endermanbugzjfc
Endermanbugzjfc marked this pull request as ready for review September 14, 2026 02:17
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.

2 participants