about summary refs log tree commit diff stats
path: root/modules/by-name/at/atuin
diff options
context:
space:
mode:
Diffstat (limited to 'modules/by-name/at/atuin')
-rw-r--r--modules/by-name/at/atuin/atuin.zsh11
-rw-r--r--modules/by-name/at/atuin/module.nix47
-rw-r--r--modules/by-name/at/atuin/secrets/encryption_key.age.license9
3 files changed, 59 insertions, 8 deletions
diff --git a/modules/by-name/at/atuin/atuin.zsh b/modules/by-name/at/atuin/atuin.zsh
index 60fb74fe..72dd7fa0 100644
--- a/modules/by-name/at/atuin/atuin.zsh
+++ b/modules/by-name/at/atuin/atuin.zsh
@@ -1,4 +1,15 @@
 #! /usr/bin/env zsh
+
+# nixos-config - My current NixOS configuration
+#
+# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+# This file is part of my nixos-config.
+#
+# You should have received a copy of the License along with this program.
+# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
+
 # shellcheck disable=SC2034,SC2153,SC2086,SC2155
 
 # Above line is because shellcheck doesn't support zsh, per
diff --git a/modules/by-name/at/atuin/module.nix b/modules/by-name/at/atuin/module.nix
index 2061fd71..6cf8a396 100644
--- a/modules/by-name/at/atuin/module.nix
+++ b/modules/by-name/at/atuin/module.nix
@@ -1,3 +1,12 @@
+# nixos-config - My current NixOS configuration
+#
+# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+# This file is part of my nixos-config.
+#
+# You should have received a copy of the License along with this program.
+# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
 {
   config,
   lib,
@@ -8,10 +17,12 @@
 in {
   options.soispha.programs.atuin = {
     enable = lib.mkEnableOption "atuin";
+
+    enableAge = lib.mkEnableOption "atuin with age keys";
   };
 
   config = lib.mkIf cfg.enable {
-    age.secrets.atuin_encryption_key = {
+    age.secrets.atuin_encryption_key = lib.mkIf cfg.enableAge {
       file = ./secrets/encryption_key.age;
       mode = "700";
       owner = "soispha";
@@ -23,17 +34,30 @@ in {
     home-manager.users.soispha = {
       programs.atuin = {
         enable = true;
-        package = pkgs.atuin-dvorak;
+
+        daemon.enable = true;
 
         # We can do this on our own.
         enableZshIntegration = false;
+
         settings = {
-          key_path = "${config.age.secrets.atuin_encryption_key.path}";
+          key_path = lib.mkMerge [
+            (lib.mkIf cfg.enableAge "${config.age.secrets.atuin_encryption_key.path}")
+            (lib.mkIf (!cfg.enableAge)
+              "${config.home-manager.users.soispha.xdg.dataHome}/atuin/atuin_secret_key.key")
+          ];
+
+          sync = lib.mkIf cfg.enableAge {
+            # The v2 sync API
+            records = true;
+          };
+          auto_sync = lib.mkIf cfg.enableAge true;
+          sync_address = lib.mkIf cfg.enableAge "https://atuin-sync.vhack.eu";
 
-          # TODO: Setup a self-hosted sync server. <2024-10-18>
-          session_path = "";
-          auto_sync = false;
-          sync_address = "";
+          logs = {
+            enabled = true;
+            dir = "${config.home-manager.users.soispha.xdg.cacheHome}/atuin/logs";
+          };
 
           # Use the rather reasonable syntax of `skim` to search.
           search_mode = "skim";
@@ -63,9 +87,16 @@ in {
             ignored_commands = [];
           };
 
+          keymap.vim-normal = {
+            "h" = "cursor-left";
+            "t" = "select-next";
+            "n" = "select-previous";
+            "s" = "cursor-right";
+          };
+
           # I currently don't want a sync deamon or a dotfiles manager running.
-          deamon.enable = false;
           dotfiles.enable = false;
+          ai.enabled = false;
         };
       };
     };
diff --git a/modules/by-name/at/atuin/secrets/encryption_key.age.license b/modules/by-name/at/atuin/secrets/encryption_key.age.license
new file mode 100644
index 00000000..eae6a84c
--- /dev/null
+++ b/modules/by-name/at/atuin/secrets/encryption_key.age.license
@@ -0,0 +1,9 @@
+nixos-config - My current NixOS configuration
+
+Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+SPDX-License-Identifier: GPL-3.0-or-later
+
+This file is part of my nixos-config.
+
+You should have received a copy of the License along with this program.
+If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.