configure zsh with home manager

This commit is contained in:
cy 2024-12-13 23:27:33 -05:00
parent 7eca12a6cf
commit 98faa338d6
6 changed files with 83 additions and 3 deletions

View file

@ -6,6 +6,9 @@
outputs,
...
}: {
imports = [
./zsh
];
home = {
username = "yt";
homeDirectory = "/home/yt";

View file

@ -6,6 +6,9 @@
outputs,
...
}: {
imports = [
./zsh
];
home = {
username = "yt";
homeDirectory = "/home/yt";

View file

@ -0,0 +1,76 @@
{
config,
lib,
inputs,
...
}: {
programs.zsh = {
enable = true;
autosuggestion = {
enable = true;
strategy = [ "history" "completion" ];
};
syntaxHighlighting = {
enable = true;
highlighters = [ "brackets" "cursor" ];
};
autocd = true;
defaultKeymap = "emacs";
antidote = {
enable = true;
useFriendlyNames = true; # why not?
plugins = [
"zsh-users/zsh-completions"
"romkatv/powerlevel10k"
"Aloxaf/fzf-tab"
"z-shell/zsh-eza"
"ohmyzsh/ohmyzsh path:plugins/colored-man-pages"
"ohmyzsh/ohmyzsh path:plugins/git"
];
};
history = {
ignoreDups = true;
ignoreAllDups = true;
ignoreSpace = true;
save = 50000;
size = 50000;
append = true;
};
historySubstringSearch= {
enable = true;
searchUpKey = "^p";
searchDownKey = "^n";
};
initExtra = ''
source ${./p10k.zsh}
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
zstyle ':completion:*' menu no
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls $realpath'
zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-prewview 'ls $realpath'
'';
shellAliases = {
"vi" = "nvim";
"vim" = "nvim";
"t" = "tmux";
"tl" = "tmux list-sessions";
"ta" = "tmux new-session -A -s";
"se" = "sudoedit";
"s" = "sudo";
"nrs" = "sudo nixos-rebuild switch --flake .";
"nrt" = "sudo nixos-rebuild test --flake .";
};
sessionVariables = {
"FZF_DEFAULT_COMMAND" = "rg";
};
};
programs.fzf = {
enable = true;
enableZshIntegration = true;
};
programs.zoxide = {
enable = true;
enableZshIntegration = true;
};
}

View file

@ -179,7 +179,7 @@
# - verbose: Enable instant prompt and print a warning when detecting console output during
# zsh initialization. Choose this if you've never tried instant prompt, haven't
# seen the warning, or if you are unsure what this all means.
typeset -g POWERLEVEL9K_INSTANT_PROMPT=verbose
typeset -g POWERLEVEL9K_INSTANT_PROMPT=off
# Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized.
# For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload

View file

@ -69,7 +69,6 @@ in {
};
users.users.root.openssh.authorizedKeys.keys =
[ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPdhAQYy0+vS+QmyCd0MAbqbgzyMGcsuuFyf6kg2yKge yt@ytlinux" ];
programs.zsh.enable = true;
users.users.git = {
isNormalUser = true;

View file

@ -131,7 +131,6 @@
enable = true;
wayland.enable = true;
};
programs.zsh.enable = true;
# security.sudo.wheelNeedsPassword = false;
fonts.packages = with pkgs; [