Files
nixos/Droidnix/generated/system/applications/terminal_shell/zsh.nix
T
2026-03-08 11:14:46 +01:00

69 lines
1.8 KiB
Nix

{ config, pkgs, lib, user, ... }:
let
zshConfigDir = "${config.home-manager.users.${user.username}.xdg.configHome}/zsh";
in
{
home-manager.users.${user.username} = {
# Install zsh-syntax-highlighting
home.packages = with pkgs; [
zsh-syntax-highlighting
starship
];
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
oh-my-zsh = {
enable = true;
theme = "agnoster";
plugins = [
"git"
"docker"
"kubectl"
"history"
"command-not-found"
"extract"
];
};
shellAliases = {
ls = "exa --icons -a --group-directories-first";
ll = "exa --icons -la --group-directories-first";
};
};
# Consolidated .zshrc
xdg.configFile."zsh/.zshrc".text = lib.concatStringsSep "\n" [
"# Oh-My-Zsh"
"export ZSH=\"${zshConfigDir}\""
"source \"${pkgs.zsh}/share/zsh/functions/Newuser/zsh-newuser-install\""
"source \"${zshConfigDir}/oh-my-zsh.sh\""
""
"# Zsh options"
"setopt AUTO_CD"
"setopt CORRECT"
"setopt INTERACTIVE_COMMENTS"
""
"# zsh-syntax-highlighting (manually sourced)"
"source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
""
"# Starship"
"eval \"$(starship init zsh)\""
""
"# fzf"
"source \"${pkgs.fzf}/shell/key-bindings.zsh\""
"source \"${pkgs.fzf}/shell/completion.zsh\""
""
"# User customizations"
"source \"${zshConfigDir}/custom.zsh\" 2>/dev/null"
];
# User customizations
xdg.configFile."zsh/custom.zsh".text = ''
export EDITOR="nvim"
export PATH="$HOME/.local/bin:$PATH"
'';
};
}