about summary refs log tree commit diff stats
path: root/modules/by-name/at/atuin/module.nix
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-10-18 23:23:56 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-10-18 23:23:56 +0200
commite7fdb3737774b4d7a5549d6d282944b6f468ab55 (patch)
tree0282a704fbdbc95764810eb029875051f2238993 /modules/by-name/at/atuin/module.nix
parentfix(modules/legacy/conf): Remove outdated imports of migrated modules (diff)
downloadnixos-config-e7fdb3737774b4d7a5549d6d282944b6f468ab55.tar.gz
nixos-config-e7fdb3737774b4d7a5549d6d282944b6f468ab55.zip
feat(modules/atuin): Init
Diffstat (limited to 'modules/by-name/at/atuin/module.nix')
-rw-r--r--modules/by-name/at/atuin/module.nix92
1 files changed, 92 insertions, 0 deletions
diff --git a/modules/by-name/at/atuin/module.nix b/modules/by-name/at/atuin/module.nix
new file mode 100644
index 00000000..7adc34e1
--- /dev/null
+++ b/modules/by-name/at/atuin/module.nix
@@ -0,0 +1,92 @@
+{
+  config,
+  lib,
+  ...
+}: let
+  cfg = config.soispha.programs.atuin;
+in {
+  options.soispha.programs.atuin = {
+    enable = lib.mkEnableOption "atuin";
+  };
+
+  config = lib.mkIf cfg.enable {
+    age.secrets.atuin_encryption_key = {
+      file = ./secrets/encryption_key.age;
+      mode = "700";
+      owner = "soispha";
+      group = "users";
+    };
+
+    home-manager.users.soispha = {
+      programs.atuin = {
+        enable = true;
+        enableZshIntegration = config.soispha.programs.zsh.enable;
+        settings = {
+          key_path = "${config.age.secrets.atuin_encryption_key.path}";
+
+          # TODO: Setup a self-hosted sync server. <2024-10-18>
+          session_path = "";
+          auto_sync = false;
+          sync_address = "";
+
+          # Use the rather reasonable syntax of `skim` to search.
+          search_mode = "skim";
+
+          # Filter by files in a git directory, when in one.
+          # The filtermode can still be changed with `<Ctrl-r>` later.
+          workspaces = true;
+
+          # Save some space, by setting the mode to 'compact' and the height to 1 (meaning
+          # `atuin` may only use 1 line in the terminal).
+          style = "compact";
+          inline_height = 1;
+
+          # 'k' and 'j' to move up and down.
+          keymap_mode = "vim-normal";
+          keymap_cursor = {
+            emacs = "blink-underline";
+            vim_insert = "blink-block";
+            vim_normal = "blink-bar";
+          };
+
+          # Who wants software, that automatically calls home?!
+          update_check = false;
+
+          stats = {
+            # Commands with subcommands
+            # This list contains the defaults plus `nix`
+            common_subcommands = [
+              "apt"
+              "cargo"
+              "composer"
+              "dnf"
+              "docker"
+              "git"
+              "go"
+              "ip"
+              "kubectl"
+              "nix"
+              "nix"
+              "nmcli"
+              "npm"
+              "pecl"
+              "pnpm"
+              "podman"
+              "port"
+              "systemctl"
+              "tmux"
+              "yarn"
+            ];
+
+            # This overrides the default value.
+            ignored_commands = [];
+          };
+
+          # I currently don't want a sync deamon or a dotfiles manager running.
+          deamon.enable = false;
+          dotfiles.enable = false;
+        };
+      };
+    };
+  };
+}