nixos-configs/modules/desktop/zsh.nix

70 lines
1.9 KiB
Nix
Raw Normal View History

2023-03-21 10:37:27 +01:00
{ config, lib, pkgs, ... }:
with lib;
with lib.my;
let cfg = config.modules.desktop.zsh;
in {
2023-06-10 09:50:14 +02:00
options.modules.desktop.zsh = { enable = mkBoolOpt false; };
2023-03-21 10:37:27 +01:00
config = mkIf cfg.enable {
environment.pathsToLink = [ "/share/zsh" ];
2023-06-10 09:50:14 +02:00
programs.zsh.enable = true;
2023-03-21 14:42:39 +01:00
2023-06-10 09:50:14 +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} = {
2023-06-10 09:50:14 +02:00
programs.zsh = {
enable = true;
history = {
save = 50000;
size = 50000;
};
enableCompletion = true;
enableAutosuggestions = true;
enableSyntaxHighlighting = true;
initExtra = ''
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
2023-06-10 09:50:14 +02:00
[[ -n "$key[Up]" ]] && bindkey -- "$key[Up]" up-line-or-beginning-search
[[ -n "$key[Down]" ]] && bindkey -- "$key[Down]" down-line-or-beginning-search
2023-03-21 10:37:27 +01:00
2023-06-10 09:50:14 +02:00
eval $(${pkgs.thefuck}/bin/thefuck --alias)
'';
oh-my-zsh = {
enable = true;
plugins = [ "git" "terraform" "systemd" ];
2023-03-21 10:37:27 +01:00
};
2023-06-10 09:50:14 +02:00
plugins = [
{
name = "nix-zsh-completions";
src = pkgs.nix-zsh-completions;
}
{
name = "zsh-completions";
src = pkgs.zsh-completions;
}
];
};
2023-09-29 03:41:56 +02:00
programs.starship = {
enable = true;
enableZshIntegration = true;
settings = {
add_newline = true;
2023-12-13 03:51:44 +01:00
cmd_duration = {
min_time = 0;
show_milliseconds = true;
};
2023-09-29 03:41:56 +02:00
scala = { symbol = " "; };
terraform = { symbol = "󱁢 "; };
nix_shell = { symbol = "󱄅 "; };
nodejs = { symbol = " "; };
2023-09-29 03:46:28 +02:00
php = { symbol = " "; };
2023-09-29 03:41:56 +02:00
};
};
2023-03-21 10:37:27 +01:00
};
};
}