programs/terminal/shell: switch to zsh

This commit is contained in:
Anthony Rodriguez 2025-01-31 20:06:43 +01:00
parent 9cb997e662
commit 6aeca28f86
Signed by: nezia
SSH key fingerprint: SHA256:Ihfpl0rUpqDevYqnzSR34OYfVLbDNkBiUjs3CpX4ykA
3 changed files with 64 additions and 7 deletions

View file

@ -1,7 +1,20 @@
{
lib,
pkgs,
config,
...
}: let
inherit (lib) mkIf;
inherit (config.local.systemVars) username;
in {
imports = [
./starship.nix
./nushell.nix
./zoxide.nix
./zsh.nix
];
config = mkIf config.local.profiles.desktop.enable {
users.users.${username}.shell = pkgs.zsh;
};
}

View file

@ -13,7 +13,6 @@
zoxideCache = "${config.hjem.users.${username}.directory}/.cache/zoxide";
in {
config = mkIf config.local.profiles.desktop.enable {
users.users.${username}.shell = pkgs.nushell;
hjem.users.${username} = {
packages = with pkgs; [carapace nushell];
files = {
@ -96,11 +95,5 @@ in {
'';
};
};
# needed for ghostty, as it runs as a systemd service (for faster startups)
systemd.user.services.ghosttyd.path = [
pkgs.carapace
pkgs.zoxide
];
};
}

View file

@ -0,0 +1,51 @@
{
lib,
pkgs,
config,
...
}: let
inherit (lib) mkIf;
inherit (config.local.systemVars) username;
in {
config = mkIf config.local.profiles.desktop.enable {
programs.zsh.enable = true;
hjem.users.${username} = {
packages = [pkgs.zsh];
files = {
".zshrc".text = ''
SAVEHIST=2000
HISTSIZE=2000
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=cyan,underline"
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern)
bindkey -v
eval "$(starship init zsh)"
eval "$(zoxide init zsh)"
source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source ${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh
# aliases
alias lg='lazygit'
alias g='git'
alias gs='git status'
alias ga='git add'
alias gc='git commit'
alias gca='git commit --amend'
alias gcm='git commit --message'
alias gk='git checkout'
alias gd='git diff'
alias gf='git fetch'
alias gl='git log'
alias gp='git push'
alias gpf='git push --force-with-lease'
alias gr='git reset'
alias gt='git stash'
alias gtp='git stash pop'
alias gu='git pull'
'';
};
};
};
}