diff --git a/nixos/homes/common/0001-make-atuin-on-zfs-fast-again.patch b/nixos/homes/common/0001-make-atuin-on-zfs-fast-again.patch index e965e3d..120fe82 100644 --- a/nixos/homes/common/0001-make-atuin-on-zfs-fast-again.patch +++ b/nixos/homes/common/0001-make-atuin-on-zfs-fast-again.patch @@ -1,6 +1,6 @@ -From b75e6fd3159896966dce2cf3af5b5be7e286ce1a Mon Sep 17 00:00:00 2001 +From 4797a2f62ab3d2716d313aa4a3170ba9672a93b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= -Date: Mon, 6 Nov 2023 15:56:26 +0100 +Date: Fri, 22 Mar 2024 08:46:07 +0100 Subject: [PATCH] make atuin on zfs fast again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -8,38 +8,38 @@ Content-Transfer-Encoding: 8bit Signed-off-by: Jörg Thalheim --- - atuin-client/src/database.rs | 3 ++- - atuin-client/src/record/sqlite_store.rs | 3 ++- + atuin-client/src/database.rs | 4 ++-- + atuin-client/src/record/sqlite_store.rs | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/atuin-client/src/database.rs b/atuin-client/src/database.rs -index c4b45302..29006d59 100644 +index b0bcae31..d8db492b 100644 --- a/atuin-client/src/database.rs +++ b/atuin-client/src/database.rs -@@ -130,7 +130,8 @@ pub async fn new(path: impl AsRef) -> Result { +@@ -137,9 +137,9 @@ pub async fn new(path: impl AsRef, timeout: f64) -> Result { } - + let opts = SqliteConnectOptions::from_str(path.as_os_str().to_str().unwrap())? - .journal_mode(SqliteJournalMode::Wal) + .journal_mode(SqliteJournalMode::Memory) + .optimize_on_close(true, None) +- .synchronous(SqliteSynchronous::Normal) + .synchronous(sqlx::sqlite::SqliteSynchronous::Off) + .with_regexp() .create_if_missing(true); - - let pool = SqlitePoolOptions::new().connect_with(opts).await?; + diff --git a/atuin-client/src/record/sqlite_store.rs b/atuin-client/src/record/sqlite_store.rs -index db709f20..eaed6f7a 100644 +index 6333bb27..1f25a55b 100644 --- a/atuin-client/src/record/sqlite_store.rs +++ b/atuin-client/src/record/sqlite_store.rs -@@ -37,7 +37,8 @@ pub async fn new(path: impl AsRef) -> Result { - } - +@@ -42,6 +42,8 @@ pub async fn new(path: impl AsRef, timeout: f64) -> Result { + let opts = SqliteConnectOptions::from_str(path.as_os_str().to_str().unwrap())? -- .journal_mode(SqliteJournalMode::Wal) + .journal_mode(SqliteJournalMode::Wal) + .journal_mode(SqliteJournalMode::Memory) + .synchronous(sqlx::sqlite::SqliteSynchronous::Off) + .foreign_keys(true) .create_if_missing(true); - - let pool = SqlitePoolOptions::new().connect_with(opts).await?; --- -2.42.0 +-- +2.43.1 \ No newline at end of file diff --git a/nixos/homes/common/terminal.nix b/nixos/homes/common/terminal.nix index c22c48a..4042690 100644 --- a/nixos/homes/common/terminal.nix +++ b/nixos/homes/common/terminal.nix @@ -36,12 +36,11 @@ enable = true; enableBashIntegration = true; enableZshIntegration = true; - package = pkgs.unstable.atuin; - # todo not needed anymore - #package = pkgs.unstable.atuin.overrideAttrs (_old: { - # # as cursed as doing mitigations=off in the kernel command line - # patches = [ ./0001-make-atuin-on-zfs-fast-again.patch ]; - #}); + #package = pkgs.unstable.atuin; + package = pkgs.unstable.atuin.overrideAttrs (_old: { + # as cursed as doing mitigations=off in the kernel command line + patches = [ ./0001-make-atuin-on-zfs-fast-again.patch ]; + }); settings = { auto_sync = true; sync_frequency = "5m";