Skip to content

Commit da98fe5

Browse files
author
Mrid22
committed
history: use config instead of flags
1 parent 663b60e commit da98fe5

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

modules/zsh/module.nix

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ in
101101
"match_prev_cmd"
102102
]
103103
);
104-
default = [ "history" ];
104+
default = [
105+
"history"
106+
"completion"
107+
];
105108
};
106109
};
107110

@@ -116,6 +119,11 @@ in
116119
default = false;
117120
description = "save timestamps with history";
118121
};
122+
share = lib.mkOption {
123+
type = lib.types.bool;
124+
default = false;
125+
description = "share history between sessions";
126+
};
119127
save = lib.mkOption {
120128
type = lib.types.int;
121129
default = 10000;
@@ -225,6 +233,15 @@ in
225233
"HISTSIZE=${toString cfg.history.size}"
226234
"HISTSAVE=${toString cfg.history.save}"
227235

236+
(lib.optionalString cfg.history.append "setopt appendhistory")
237+
(lib.optionalString cfg.history.share "setopt sharehistory")
238+
(lib.optionalString cfg.history.ignoreSpace "setopt hist_ignore_space")
239+
(lib.optionalString cfg.history.ignoreAllDups "setopt hist_ignore_all_dups")
240+
(lib.optionalString cfg.history.ignoreDups "setopt hist_ignore_dups")
241+
(lib.optionalString cfg.history.saveNoDups "setopt hist_save_no_dups")
242+
(lib.optionalString cfg.history.findNoDups "setopt histfindnodups")
243+
(lib.optionalString cfg.history.expanded "setopt extendedhistory")
244+
228245
"# Extra Content"
229246

230247
config.extraRC
@@ -254,14 +271,7 @@ in
254271

255272
flags = {
256273
"--histfcntllock" = true;
257-
"--histappend" = cfg.history.append;
258274
"--histexpiredupsfirst" = cfg.history.expireDupsFirst;
259-
"--histfindnodups" = cfg.history.findNoDups;
260-
"--histignorealldups" = cfg.history.ignoreAllDups;
261-
"--histignoredups" = cfg.history.ignoreDups;
262-
"--histignorespace" = cfg.history.ignoreSpace;
263-
"--histsavenodups" = cfg.history.saveNoDups;
264-
"--histexpand" = cfg.history.expanded;
265275
};
266276

267277
env.ZDOTDIR = builtins.toString (

0 commit comments

Comments
 (0)