Hello, using nix-darwin in conjunction with home manager. I have a flake that I am using to configure my environment.
In viewing the zsh options, I do not see a built-in option for HIST_STAMPS
, so that I may define the format of timestamps. As such, I have added the HIST_STAMPS
definition into my initExtra
block. I also have extended history enabled via the pre-defined option.
However, while my compiled .zshrc
file contains this definition, my history file does not reflect the changes. I still have just the # of the commands, but no timestamp.
Curious what I am doing incorrectly. See my zsh definition below. Note that I have removed plugins, functions, etc. as they simply bloat the code block. The configuration compiles just fine (before and after I added HIST_STAMPS
).
{ config, pkgs, ...}:
{
programs.zsh = {
enable = true;
autocd = true;
enableCompletion = true;
completionInit = "autoload -U compinit; compinit";
autosuggestion.enable= true;
syntaxHighlighting = {
enable = true;
};
history = {
save = 10000000;
size = 10000000;
share = true;
ignoreSpace = true;
ignorePatterns = [
"ls *"
"cd *"
"pwd *"
"exit *"
"cd *"
];
extended = true;
};
oh-my-zsh = {
enable = true;
plugins = [
"sudo"
"direnv"
...
];
};
initExtra = ''
if [ -f $HOME/.env ]; then
source $HOME/.env
fi
source $HOME/.zshenv
HIST_STAMPS="yyyy-mm-dd"
...
'';
envExtra = ''
'';
shellAliases = {
v="nvim";
...
};
shellGlobalAliases = {
UUID = "$(uuidgen | tr -d \\n)";
};
};
home.packages = with pkgs; [
zsh-fast-syntax-highlighting
nix-zsh-completions
zsh-nix-shell
];
}
After rebuilding:
~ ❯ cat ~/.zshrc | grep HIST_STAMPS
HIST_STAMPS="yyyy-mm-dd"
~ ❯ history | tail -n 1
3809 cat ~/.zshrc | grep HIST_STAMPS
Note: I have also attempted completely exiting my terminal, which I am not sure is necessary as it would be for a new environment variable. Regardless, that did not help either.
Thanks for whatever help you can provide.