Files
nixos/Droidnix/generated/modules/traveldroid/apps/zsh.nix
T
2026-03-30 13:23:09 +00:00

39 lines
1.0 KiB
Nix

{ lib, pkgs, flakeRoot, ... }:
let
# Path to generated zshrc (optional per-user tweaks)
generatedZsh = "${flakeRoot}/generated/.config/zsh/.zshrc";
in
{
#################################
# Install Zsh and Oh My Zsh system-wide
#################################
environment.systemPackages = with pkgs; [
zsh
oh-my-zsh
];
#################################
# Set Zsh to use ~/.config/zsh as its config directory
#################################
environment.etc."zshenv".text = ''
export ZDOTDIR=$HOME/.config/zsh
'';
#################################
# Deploy global zshrc for all users
#################################
environment.etc."zshrc".text = ''
export ZSH=${pkgs.oh-my-zsh}/share/oh-my-zsh
ZSH_THEME=""
plugins=(git sudo extract colored-man-pages command-not-found history docker kubectl)
source $ZSH/oh-my-zsh.sh
# Load optional per-user generated zshrc if it exists
[ -f "${generatedZsh}" ] && source "${generatedZsh}"
# Initialize Starship prompt
eval "$(starship init zsh)"
'';
}