From 430bc5ec109b5d69656a392edf1fac1faced476d Mon Sep 17 00:00:00 2001 From: Mrid22 Date: Wed, 25 Feb 2026 07:44:12 +0200 Subject: [PATCH] modules/zsh: use zshrc options for history instead of setting flags --- modules/zsh/module.nix | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/modules/zsh/module.nix b/modules/zsh/module.nix index 39b0bf8..4851413 100644 --- a/modules/zsh/module.nix +++ b/modules/zsh/module.nix @@ -101,7 +101,10 @@ in "match_prev_cmd" ] ); - default = [ "history" ]; + default = [ + "history" + "completion" + ]; }; }; @@ -116,6 +119,11 @@ in default = false; description = "save timestamps with history"; }; + share = lib.mkOption { + type = lib.types.bool; + default = false; + description = "share history between sessions"; + }; save = lib.mkOption { type = lib.types.int; default = 10000; @@ -225,6 +233,15 @@ in "HISTSIZE=${toString cfg.history.size}" "HISTSAVE=${toString cfg.history.save}" + (lib.optionalString cfg.history.append "setopt appendhistory") + (lib.optionalString cfg.history.share "setopt sharehistory") + (lib.optionalString cfg.history.ignoreSpace "setopt hist_ignore_space") + (lib.optionalString cfg.history.ignoreAllDups "setopt hist_ignore_all_dups") + (lib.optionalString cfg.history.ignoreDups "setopt hist_ignore_dups") + (lib.optionalString cfg.history.saveNoDups "setopt hist_save_no_dups") + (lib.optionalString cfg.history.findNoDups "setopt histfindnodups") + (lib.optionalString cfg.history.expanded "setopt extendedhistory") + "# Extra Content" config.extraRC @@ -254,14 +271,7 @@ in flags = { "--histfcntllock" = true; - "--histappend" = cfg.history.append; "--histexpiredupsfirst" = cfg.history.expireDupsFirst; - "--histfindnodups" = cfg.history.findNoDups; - "--histignorealldups" = cfg.history.ignoreAllDups; - "--histignoredups" = cfg.history.ignoreDups; - "--histignorespace" = cfg.history.ignoreSpace; - "--histsavenodups" = cfg.history.saveNoDups; - "--histexpand" = cfg.history.expanded; }; env.ZDOTDIR = builtins.toString (