nixos: patch keepbook-sync-daemon for updated sync_all_if_stale

This commit is contained in:
2026-02-18 10:59:20 -08:00
committed by Kat Huang
parent 4505d9f3cb
commit 716c28750e
2 changed files with 30 additions and 1 deletions

View File

@@ -2,11 +2,16 @@
let let
cfg = config.myModules."keepbook-sync"; cfg = config.myModules."keepbook-sync";
keepbookTray = 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 # 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 # entrypoint under ts/dist/, but the Nix build does not build the TS
# artifacts first. Skip checks to keep the package usable on NixOS. # artifacts first. Skip checks to keep the package usable on NixOS.
doCheck = false; 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 = [ daemonArgs = [

View File

@@ -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 {