From 7d5e904fb2b5fe616fbfde2bc723d5e6ad56838b Mon Sep 17 00:00:00 2001 From: Bryan Lai Date: Thu, 13 Nov 2025 14:00:04 +0800 Subject: [PATCH 1/2] chore: ignore .DS_Store --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 5645a14..95e70d3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ +.DS_Store *.swp result* From 454d8d95c60367a91f329b0bd845e344b2c6cced Mon Sep 17 00:00:00 2001 From: Bryan Lai Date: Thu, 13 Nov 2025 14:54:56 +0800 Subject: [PATCH 2/2] zsh: allow configuring history --- modules/programs/zsh/default.nix | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/modules/programs/zsh/default.nix b/modules/programs/zsh/default.nix index 0ad0f74..c5de334 100644 --- a/modules/programs/zsh/default.nix +++ b/modules/programs/zsh/default.nix @@ -59,6 +59,18 @@ in description = "Shell script code used to initialise the zsh prompt."; }; + programs.zsh.histSize = mkOption { + type = types.int; + default = 2000; + description = "Change history size."; + }; + + programs.zsh.histFile = mkOption { + type = types.str; + default = "$HOME/.zsh_history"; + description = "Change history file."; + }; + programs.zsh.enableCompletion = mkOption { type = types.bool; default = true; @@ -189,10 +201,11 @@ in if [ -n "$__ETC_ZSHRC_SOURCED" -o -n "$NOSYSZSHRC" ]; then return; fi __ETC_ZSHRC_SOURCED=1 - # history defaults - SAVEHIST=2000 - HISTSIZE=2000 - HISTFILE=$HOME/.zsh_history + # Setup command line history. + # Don't export these, otherwise other shells (bash) will try to use same HISTFILE. + SAVEHIST=${builtins.toString cfg.histSize} + HISTSIZE=${builtins.toString cfg.histSize} + HISTFILE=${cfg.histFile} setopt HIST_IGNORE_DUPS SHARE_HISTORY HIST_FCNTL_LOCK