aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2026-10-21 19:24:47 +0200
committerMartin Fischer <martin@push-f.com>2026-10-30 18:02:24 +0100
commitffa7c4e2bd9816d1a085163dcc5efe15c8a2fdc5 (patch)
tree2c56ad1b5dc70b536d544d4109558f3f8bf3de01
parente3f5f1335b657985e61b0ce7c0413c50cbfd8c5a (diff)
tweak(ev): stop patching anki-sync-server
It takes too long to compile even on good hardware.
-rw-r--r--nixos/hosts/ev/default.nix16
-rw-r--r--nixos/hosts/ev/patches/anki-sync-server-delete-exclusive-lock.patch12
2 files changed, 10 insertions, 18 deletions
diff --git a/nixos/hosts/ev/default.nix b/nixos/hosts/ev/default.nix
index dc77416..bf64198 100644
--- a/nixos/hosts/ev/default.nix
+++ b/nixos/hosts/ev/default.nix
@@ -148,12 +148,6 @@ in
age.secrets.anki-sync-server-martin.file = ./secrets/anki-sync-server-martin.age;
services.anki-sync-server = {
enable = true;
- package = pkgs.anki-sync-server.overrideAttrs (old: {
- patches = old.patches ++ [
- # Patch to remove locking_mode=exclusive (see https://forums.ankiweb.net/t/69051).
- ./patches/anki-sync-server-delete-exclusive-lock.patch
- ];
- });
port = ports.ankiSyncServer;
address = "0.0.0.0";
users = [
@@ -246,6 +240,16 @@ in
pruneOpts = ["--keep-daily 30" "--keep-weekly 8" "--keep-monthly 12"];
};
+ # Anki opens its SQLite database with an exclusive lock.
+ systemd.services.restic-backups-sqlite-anki-martin = {
+ preStart = lib.mkBefore ''
+ ${pkgs.systemd}/bin/systemctl stop anki-sync-server.service
+ '';
+ postStop = lib.mkAfter ''
+ ${pkgs.systemd}/bin/systemctl start anki-sync-server.service
+ '';
+ };
+
services.restic.backups = {
media = {
repository = "sftp://${backupHost}:23" + "/media";
diff --git a/nixos/hosts/ev/patches/anki-sync-server-delete-exclusive-lock.patch b/nixos/hosts/ev/patches/anki-sync-server-delete-exclusive-lock.patch
deleted file mode 100644
index fdb8990..0000000
--- a/nixos/hosts/ev/patches/anki-sync-server-delete-exclusive-lock.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/rslib/src/storage/sqlite.rs b/rslib/src/storage/sqlite.rs
-index 7f68496b4..e8f711941 100644
---- a/rslib/src/storage/sqlite.rs
-+++ b/rslib/src/storage/sqlite.rs
-@@ -62,7 +62,6 @@ fn open_or_create_collection_db(path: &Path) -> Result<Connection> {
-
- db.busy_timeout(std::time::Duration::from_secs(0))?;
-
-- db.pragma_update(None, "locking_mode", "exclusive")?;
- db.pragma_update(None, "page_size", 4096)?;
- db.pragma_update(None, "cache_size", -40 * 1024)?;
- db.pragma_update(None, "legacy_file_format", false)?;