nix-configs/local-configs/zsh/default.nix

62 lines
1.6 KiB
Nix
Raw Normal View History

2024-01-22 02:30:43 +00:00
{ config, pkgs, ... }:
{
programs.zsh = {
enable = true;
dotDir = ".config/zsh";
history = {
extended = true;
};
localVariables = {
# Enable Oh My Zsh history timestamp output.
# See: https://github.com/ohmyzsh/ohmyzsh/wiki/Settings#hist_stamps
HIST_STAMPS = "yyyy-mm-dd";
};
# Make use of Oh My Zsh
# See the projects sites:
# https://ohmyz.sh/
# https://github.com/ohmyzsh/ohmyzsh/
# See the projects documentation:
# https://github.com/ohmyzsh/ohmyzsh/wiki
oh-my-zsh = {
enable = true;
theme = "agnoster";
custom = "/home/forestcat/.config/oh-my-zsh-custom";
plugins = [
"history-substring-search"
"timer"
"pass"
];
extraConfig = ''
# Only show the command execution timer, if the command ran for at least 15 seconds.
TIMER_THRESHOLD=15
'';
};
initExtra = ''
nx() {
nix shell nixpkgs/nixos-23.11#$@
}
# history-substring-search configuration
# See: https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/history-substring-search#configuration
# Ensure unique search results in history-substring-search.
# Needs to be set here instead of in oh-my-zsh.extraConfig to work apparently.
HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE=1
'';
shellAliases = {
# Others.
miau = "echo miau";
ll = "ls -l";
cheetah = "curl -d 'Lena: Done ' https://ntfy.forestcat.org/cheetah";
rebuild = "sudo nixos-rebuild switch --flake ~/nix-configs/ --show-trace";
};
};
}