Bundle pimsync 0.5.11 in the flake package; enforce it as the version floor

The Nix-packaged calcalist now wraps its PATH with a pinned pimsync
0.5.11 build, so discover works regardless of what else is on the
user's PATH. discover's output format is undocumented and changed
between 0.5.9 and 0.5.11 in a way the parser doesn't handle; doctor
and the NotFound error now enforce 0.5.11 as a floor instead of
accepting any 0.5.x patch. README's install instructions and pimsync
note are corrected to match.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
randogoth 2026-09-10 17:10:43 +03:00
parent 47606a64b7
commit 3d701361da
4 changed files with 64 additions and 9 deletions

View file

@ -18,6 +18,31 @@
system:
let
pkgs = import nixpkgs { inherit system; };
# nixpkgs currently ships pimsync 0.5.9, but `discover`'s output
# format is undocumented and changed between 0.5.9 and 0.5.11 —
# calcalist's parser only understands the newer shape (see
# SUPPORTED_PATCH_MIN in src/pimsync.rs). Build the exact version
# rather than trust whatever nixpkgs happens to carry.
pimsync0_5_11 = pkgs.rustPlatform.buildRustPackage (finalAttrs: {
pname = "pimsync";
version = "0.5.11";
src = pkgs.fetchFromSourcehut {
owner = "~whynothugo";
repo = "pimsync";
rev = "v${finalAttrs.version}";
hash = "sha256-iMdBqSSguViF+54e47IGV8hH3qvTxcNkWkmND1QAAxw=";
};
cargoHash = "sha256-dvkZ047eJnvYvyH1iW1NJo3Uv0L2T7waPYKN12bi+dA=";
# Skips build.rs's `git describe` call, which has nothing to
# describe once fetched as a plain source tarball.
env.PIMSYNC_VERSION = finalAttrs.version;
nativeBuildInputs = [ pkgs.pkg-config ];
buildInputs = [ pkgs.sqlite ];
doCheck = false;
});
in
rec {
calcalist = pkgs.rustPlatform.buildRustPackage {
@ -31,6 +56,15 @@
# check), not something a package build should re-run.
doCheck = false;
nativeBuildInputs = [ pkgs.makeWrapper ];
# Ensures the pimsync calcalist finds is the one it was tested
# against, regardless of what else is on the user's PATH.
postInstall = ''
wrapProgram $out/bin/calcalist \
--prefix PATH : ${pkgs.lib.makeBinPath [ pimsync0_5_11 ]}
'';
meta = {
description = cargoToml.package.description;
license = pkgs.lib.licenses.mit;