Skip to content

Dev Exp: Nix development shell and package. - #10

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

Endermanbugzjfc wants to merge 7 commits into
alvesvaren:mainfrom
Endermanbugzjfc:Endermanbugzjfc-nix

Conversation

@Endermanbugzjfc

@Endermanbugzjfc Endermanbugzjfc commented Jul 27, 2026 •

Copy link
Copy Markdown

Background

This pull request packages the program for the Nix package manager alongside adding a reproducible development shell.

Currently, the development environment of the project is not fully reproducible, as some required packages, such as aarch64-linux-gnu-gcc, appear to be missing on certain platforms.

Therefore, extra effort is needed to locate an alternative toolchain, even to get the rust-analyzer language server working without errors.

Changes

  • A Nix Flake (like a "manifest file" for the Nix package manager) is added to export a (build-from-source) package and a development shell.
  • The packages should install the udev rule, systemd service (without enabling it), and the required runtime dependencies.
  • The development shell should install the required toolchain to build the package and make rust-analyzer run fine.
  • The (build-from-source) package and shell should (testing volunteers wanted) function equally in multiple platforms that have Nix installed (and Nix Flake enabled).

Live tests

Tests are done 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

Potentially useful features roadmap

Ezjfc and others added 6 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.
@Endermanbugzjfc
Endermanbugzjfc marked this pull request as ready for review July 28, 2026 02:20
@Endermanbugzjfc
Endermanbugzjfc marked this pull request as draft July 28, 2026 02:20
Comment thread README.md Resolved
Comment thread flake.nix Resolved
Co-authored-by: EndermanbugZJFC <53002741+Endermanbugzjfc@users.noreply.github.com>
@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