nixos/zsh: enable configure history and custom options
This commit is contained in:
parent
c94f6f22d8
commit
53d05fd0cc
@ -79,6 +79,33 @@ in
|
|||||||
type = types.lines;
|
type = types.lines;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
histSize = mkOption {
|
||||||
|
default = 2000;
|
||||||
|
description = ''
|
||||||
|
Change history size.
|
||||||
|
'';
|
||||||
|
type = types.int;
|
||||||
|
};
|
||||||
|
|
||||||
|
histFile = mkOption {
|
||||||
|
default = "$HOME/.zsh_history";
|
||||||
|
description = ''
|
||||||
|
Change history file.
|
||||||
|
'';
|
||||||
|
type = types.str;
|
||||||
|
};
|
||||||
|
|
||||||
|
setOptions = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
default = [
|
||||||
|
"HIST_IGNORE_DUPS" "SHARE_HISTORY" "HIST_FCNTL_LOCK"
|
||||||
|
];
|
||||||
|
example = [ "EXTENDED_HISTORY" "RM_STAR_WAIT" ];
|
||||||
|
description = ''
|
||||||
|
Configure zsh options.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
enableCompletion = mkOption {
|
enableCompletion = mkOption {
|
||||||
default = true;
|
default = true;
|
||||||
description = ''
|
description = ''
|
||||||
@ -162,12 +189,11 @@ in
|
|||||||
|
|
||||||
. /etc/zinputrc
|
. /etc/zinputrc
|
||||||
|
|
||||||
# history defaults
|
export SAVEHIST=${toString cfg.histSize}
|
||||||
SAVEHIST=2000
|
export HISTSIZE=${toString cfg.histSize}
|
||||||
HISTSIZE=2000
|
export HISTFILE=${cfg.histFile}
|
||||||
HISTFILE=$HOME/.zsh_history
|
|
||||||
|
|
||||||
setopt HIST_IGNORE_DUPS SHARE_HISTORY HIST_FCNTL_LOCK
|
${optionalString (cfg.setOptions != []) "setopt ${concatStringsSep " " cfg.setOptions}"}
|
||||||
|
|
||||||
HELPDIR="${pkgs.zsh}/share/zsh/$ZSH_VERSION/help"
|
HELPDIR="${pkgs.zsh}/share/zsh/$ZSH_VERSION/help"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user