Files
nix/hosts/common/configs/user/console/zsh/default.nix
Nikolaos Karaolidis 855edc83f4 Update
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
2025-04-25 17:35:29 +03:00

44 lines
1.1 KiB
Nix

{
user ? throw "user argument is required",
home ? throw "home argument is required",
}:
{ config, pkgs, ... }:
{
environment = {
persistence."/persist"."${home}/.local/share/zsh" = { };
# If we set this under home-manager.users.${user}.home.sessionVariables,
# it runs too late in the init process and zsh fails.
sessionVariables.ZDOTDIR = "$HOME/.config/zsh";
};
home-manager.users.${user} = {
imports = [ ./options.nix ];
programs.zsh = {
enable = true;
dotDir = ".config/zsh";
autocd = true;
history = {
path = "${home}/.local/share/zsh/history";
expireDuplicatesFirst = true;
append = true;
};
historySubstringSearch.enable = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
plugins = [
{
name = "powerlevel10k";
src = pkgs.zsh-powerlevel10k;
file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
}
];
initContent = ''
source ${./.p10k.zsh}
'';
};
home.file.".zshenv".enable = false;
};
}