Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion modules/programs/zsh/history.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ in
{ config, ... }:
{
options = {
enableConfig = lib.mkOption {
type = types.bool;
default = true;
description = "let home-manager configure history settings";
};

append = mkOption {
type = types.bool;
default = false;
Expand Down Expand Up @@ -170,7 +176,7 @@ in
};
};

config = {
config = lib.mkIf cfg.history.enableConfig {
warnings =
lib.optionals (!lib.hasPrefix "/" cfg.history.path && !lib.hasInfix "$" cfg.history.path)
[
Expand Down
1 change: 1 addition & 0 deletions tests/modules/programs/zsh/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
zsh-dotdir-default = import ./dotdir.nix "default";
zsh-dotdir-relative = import ./dotdir.nix "relative";
zsh-dotdir-shell-variable = import ./dotdir.nix "shell-variable";
zsh-history-disable-config = ./history-disable-config.nix;
zsh-history-ignore-pattern = ./history-ignore-pattern.nix;
zsh-history-path-absolute = import ./history-path.nix "absolute";
zsh-history-path-default = import ./history-path.nix "default";
Expand Down
10 changes: 10 additions & 0 deletions tests/modules/programs/zsh/history-disable-config.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
programs.zsh = {
enable = true;
history.enableConfig = false;
};

nmt.script = ''
assertFileNotRegex home-files/.zshrc "setopt HIST_.*"
'';
}