Commit 5dd7370

HPCesia <me@hpcesia.com>
2026-10-14 08:41:03
shell: use stinkpot for shell history
1 parent 35528e9
Changed files (1)
modules
core
modules/core/shell/default.nix
@@ -53,20 +53,22 @@
     };
 
     provides.to-users = {
-      hjem = {lib, ...}: {
+      persistHome = {config, ...}: {
+        directories = [
+          "${config.xdg.data.directory}/stinkpot"
+        ];
+      };
+
+      hjem = {
+        pkgs,
+        lib,
+        ...
+      }: {
+        packages = [pkgs.nur.repos.hpcesia.stinkpot];
+
         files.".bashrc".text = lib.mkOrder 2000 ''
-          # Make bash history save immediately
-          shopt -s histappend
-          __ix_history_flush() {
-            history -a
-          }
-          if [[ ";''${PROMPT_COMMAND[*]:-};" != *";__ix_history_flush;"* ]]; then
-            if [[ "$(declare -p PROMPT_COMMAND 2>&1)" == "declare -a"* ]]; then
-              PROMPT_COMMAND=("''${PROMPT_COMMAND[@]}" __ix_history_flush)
-            else
-              PROMPT_COMMAND="''${PROMPT_COMMAND:+$PROMPT_COMMAND;}__ix_history_flush"
-            fi
-          fi
+          eval "$(${lib.getExe pkgs.nur.repos.hpcesia.stinkpot} init)"
+          flyline key bind Ctrl+r 'always=runBashCommand(__stinkpot_search)'
 
           # Fix Flyline panic in Zellij
           __ix_fix_term_size() {