Skip to content

Commit

Permalink
Merge pull request #57856 from Izorkin/zsh-options
Browse files Browse the repository at this point in the history
nixos/zsh: enable configure history and custom options
  • Loading branch information
disassembler committed Mar 20, 2019
2 parents cafd07a + 53d05fd commit 4399361
Showing 1 changed file with 31 additions and 5 deletions.
36 changes: 31 additions & 5 deletions nixos/modules/programs/zsh/zsh.nix
Expand Up @@ -79,6 +79,33 @@ in
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 {
default = true;
description = ''
Expand Down Expand Up @@ -162,12 +189,11 @@ in
. /etc/zinputrc
# history defaults
SAVEHIST=2000
HISTSIZE=2000
HISTFILE=$HOME/.zsh_history
export SAVEHIST=${toString cfg.histSize}
export HISTSIZE=${toString cfg.histSize}
export HISTFILE=${cfg.histFile}
setopt HIST_IGNORE_DUPS SHARE_HISTORY HIST_FCNTL_LOCK
${optionalString (cfg.setOptions != []) "setopt ${concatStringsSep " " cfg.setOptions}"}
HELPDIR="${pkgs.zsh}/share/zsh/$ZSH_VERSION/help"
Expand Down

0 comments on commit 4399361

Please sign in to comment.