nixos-configs/modules/desktop/zsh.nix

98 lines
2.2 KiB
Nix
Raw Normal View History

2024-08-20 22:58:24 +02:00
{
config,
lib,
pkgs,
...
}:
2023-03-21 10:37:27 +01:00
2024-08-20 22:58:24 +02:00
let
cfg = config.modules.desktop.zsh;
in
{
options.modules.desktop.zsh = {
enable = lib.my.mkBoolOpt false;
};
2024-07-12 04:12:20 +02:00
config = lib.mkIf cfg.enable {
2023-03-21 10:37:27 +01:00
environment.pathsToLink = [ "/share/zsh" ];
2023-06-10 09:50:14 +02:00
programs.zsh.enable = true;
2023-03-21 14:42:39 +01:00
2024-08-20 22:58:24 +02:00
users.users.${config.user.name} = {
shell = pkgs.zsh;
};
2023-03-21 14:42:39 +01:00
2023-03-21 10:37:27 +01:00
home-manager.users.${config.user.name} = {
2024-08-20 22:58:24 +02:00
programs = {
zsh = {
enable = true;
history = {
save = 50000;
size = 50000;
};
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
2025-05-29 02:21:12 +02:00
initContent = # bash
2024-08-20 22:58:24 +02:00
''
autoload -Uz up-line-or-beginning-search down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
2023-03-21 10:37:27 +01:00
2024-08-20 22:58:24 +02:00
[[ -n "$key[Up]" ]] && bindkey -- "$key[Up]" up-line-or-beginning-search
[[ -n "$key[Down]" ]] && bindkey -- "$key[Down]" down-line-or-beginning-search
'';
oh-my-zsh = {
enable = true;
plugins = [
"git"
"terraform"
"systemd"
];
};
plugins = [
{
name = "nix-zsh-completions";
src = pkgs.nix-zsh-completions;
}
{
name = "zsh-completions";
src = pkgs.zsh-completions;
}
];
};
2025-07-31 17:10:33 +02:00
pay-respects = {
2023-06-10 09:50:14 +02:00
enable = true;
2024-08-20 22:58:24 +02:00
enableZshIntegration = true;
2023-03-21 10:37:27 +01:00
};
2024-08-20 22:58:24 +02:00
starship = {
enable = true;
enableZshIntegration = true;
settings = {
add_newline = true;
cmd_duration = {
min_time = 0;
show_milliseconds = true;
};
scala = {
symbol = " ";
};
terraform = {
symbol = "󱁢 ";
};
nix_shell = {
symbol = "󱄅 ";
};
nodejs = {
symbol = " ";
};
php = {
symbol = " ";
};
2023-12-13 03:51:44 +01:00
};
2023-09-29 03:41:56 +02:00
};
};
2023-03-21 10:37:27 +01:00
};
};
}