From 716c28750e873a5f9c721559de20fb33026208e7 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Wed, 18 Feb 2026 10:59:20 -0800 Subject: [PATCH] nixos: patch keepbook-sync-daemon for updated sync_all_if_stale --- nixos/keepbook-sync.nix | 7 +++++- ...ok-sync-daemon-transaction-sync-mode.patch | 24 +++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 nixos/patches/keepbook-sync-daemon-transaction-sync-mode.patch diff --git a/nixos/keepbook-sync.nix b/nixos/keepbook-sync.nix index 03d1244e..7a2b803b 100644 --- a/nixos/keepbook-sync.nix +++ b/nixos/keepbook-sync.nix @@ -2,11 +2,16 @@ let cfg = config.myModules."keepbook-sync"; keepbookTray = - inputs.keepbook.packages.${pkgs.stdenv.hostPlatform.system}.keepbook-tray.overrideAttrs (_: { + inputs.keepbook.packages.${pkgs.stdenv.hostPlatform.system}.keepbook-tray.overrideAttrs (old: { # Upstream currently includes a contract test that expects a built TS CLI # entrypoint under ts/dist/, but the Nix build does not build the TS # artifacts first. Skip checks to keep the package usable on NixOS. doCheck = false; + + # keepbook @ 385a4eb has a mismatch between an updated `sync_all_if_stale` + # signature and the keepbook-sync-daemon call-site; patch it in Nix until + # upstream fixes the build. + patches = (old.patches or []) ++ [ ./patches/keepbook-sync-daemon-transaction-sync-mode.patch ]; }); daemonArgs = [ diff --git a/nixos/patches/keepbook-sync-daemon-transaction-sync-mode.patch b/nixos/patches/keepbook-sync-daemon-transaction-sync-mode.patch new file mode 100644 index 00000000..f0665ef8 --- /dev/null +++ b/nixos/patches/keepbook-sync-daemon-transaction-sync-mode.patch @@ -0,0 +1,24 @@ +diff --git a/src/bin/keepbook-sync-daemon.rs b/src/bin/keepbook-sync-daemon.rs +index 7410f35..880b44a 100644 +--- a/src/bin/keepbook-sync-daemon.rs ++++ b/src/bin/keepbook-sync-daemon.rs +@@ -10,6 +10,7 @@ use chrono::{DateTime, Local}; + use clap::Parser; + use keepbook::app; + use keepbook::config::{default_config_path, ResolvedConfig}; ++use keepbook::sync::TransactionSyncMode; + use keepbook::format::format_base_currency_display; + use keepbook::storage::{JsonFileStorage, Storage}; + use ksni::menu::*; +@@ -573,7 +574,9 @@ impl KeepbookTrayState { + merge_origin_master: self.config.git.merge_master_before_command, + }, + )?; + +- let sync_json = app::sync_all_if_stale(self.storage.clone(), &self.config).await?; ++ let sync_json = ++ app::sync_all_if_stale(self.storage.clone(), &self.config, TransactionSyncMode::Auto) ++ .await?; + let sync_counts = parse_sync_counts(&sync_json); + + let (prices_fetched, prices_skipped, prices_failed) = if self.sync_prices {