aboutsummaryrefslogtreecommitdiff
path: root/nixos
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-22 06:12:29 +0200
commit6b6a5f5e14d8bc7fd9c844648937c607f581b241 (patch)
treee41600a9b6b08468ff91eecd242f0d9d0189bec2 /nixos
parent11fa496c859431dc8be81593f776ca3f9cbcffb7 (diff)
tweak(ev): stop patching anki-sync-server
It takes too long to compile even on good hardware.
Diffstat (limited to 'nixos')
-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)?;