Skip to content

Commit

Permalink
fix(shell): Add atuin patch for ZFS
Browse files Browse the repository at this point in the history
  • Loading branch information
edmundmiller committed Nov 14, 2023
1 parent b366273 commit 9af1fa3
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/shell/nushell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ in {
};
atuin.enable = true;
atuin.enableNushellIntegration = true;
atuin.package = pkgs.my.atuin;
carapace.enable = true;
carapace.enableNushellIntegration = true;

Expand Down
41 changes: 41 additions & 0 deletions packages/0001-make-atuin-on-zfs-fast-again.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
From 5c3e107d5ddcab29e12cfa1dcc56330261eb7242 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
Date: Mon, 6 Nov 2023 15:56:26 +0100
Subject: [PATCH] make atuin on zfs fast again
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
---
atuin-client/src/database.rs | 1 +
atuin-client/src/record/sqlite_store.rs | 1 +
2 files changed, 2 insertions(+)

diff --git a/atuin-client/src/database.rs b/atuin-client/src/database.rs
index c4b45302..15ba723c 100644
--- a/atuin-client/src/database.rs
+++ b/atuin-client/src/database.rs
@@ -131,6 +131,7 @@ pub async fn new(path: impl AsRef<Path>) -> Result<Self> {

let opts = SqliteConnectOptions::from_str(path.as_os_str().to_str().unwrap())?
.journal_mode(SqliteJournalMode::Wal)
+ .synchronous(sqlx::sqlite::SqliteSynchronous::Off)
.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..0a72fee0 100644
--- a/atuin-client/src/record/sqlite_store.rs
+++ b/atuin-client/src/record/sqlite_store.rs
@@ -38,6 +38,7 @@ pub async fn new(path: impl AsRef<Path>) -> Result<Self> {

let opts = SqliteConnectOptions::from_str(path.as_os_str().to_str().unwrap())?
.journal_mode(SqliteJournalMode::Wal)
+ .synchronous(sqlx::sqlite::SqliteSynchronous::Off)
.create_if_missing(true);

let pool = SqlitePoolOptions::new().connect_with(opts).await?;
--
2.42.0

5 changes: 5 additions & 0 deletions packages/atuin.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{atuin}:
atuin.overrideAttrs (old: {
# as cursed as doing mitigations=off in the kernel command line
patches = [./0001-make-atuin-on-zfs-fast-again.patch];
})

0 comments on commit 9af1fa3

Please sign in to comment.