switch default shell to zsh and adopt catppuccin mocha

This commit is contained in:
Rasyidan Akbar F. 2026-09-02 15:08:13 +07:00
commit a58e842817
15 changed files with 391 additions and 160 deletions

View file

@ -181,22 +181,24 @@ in
$env.NIX_PROFILES = "/run/current-system/sw ${config.home.profileDirectory}"
# Load globally scoped sops-managed environment variables.
let global_secrets_file = "${config.xdg.configHome}/secrets/global-env.yaml"
# Load each globally scoped sops-managed environment variable.
let global_secrets_dir = "${config.xdg.configHome}/secrets/global-env"
def --env load-global-secrets [secret_file: string] {
if ($secret_file | path exists) {
let secret_values = (open $secret_file)
def --env load-global-secrets [secret_dir: string] {
if ($secret_dir | path exists) {
let secret_values = (
ls $secret_dir
| reduce -f {} {|entry, acc|
let name = ($entry.name | path basename)
let value = (open --raw $entry.name | str trim)
$acc | upsert $name $value
}
)
$secret_values
| transpose name value
| reduce -f {} {|entry, acc|
$acc | upsert $entry.name ($entry.value | into string)
}
| load-env
$secret_values | load-env
}
}
load-global-secrets $global_secrets_file
load-global-secrets $global_secrets_dir
'';
}

View file

@ -4,6 +4,7 @@
enable = lib.mkDefault true;
enableFishIntegration = true;
enableNushellIntegration = true;
enableZshIntegration = true;
settings = lib.importTOML ./starship.toml;
};
}

View file

@ -1,15 +1,15 @@
"$schema" = "https://starship.rs/config-schema.json"
format = """
[](color_orange)\
[](peach)\
$os\
$username\
[](bg:color_yellow fg:color_orange)\
[](bg:yellow fg:peach)\
$directory\
[](fg:color_yellow bg:color_aqua)\
[](fg:yellow bg:teal)\
$git_branch\
$git_status\
[](fg:color_aqua bg:color_blue)\
[](fg:teal bg:blue)\
$c\
$cpp\
$rust\
@ -20,32 +20,49 @@ $java\
$kotlin\
$haskell\
$python\
[](fg:color_blue bg:color_bg3)\
[](fg:blue bg:surface0)\
$docker_context\
$conda\
$pixi\
[](fg:color_bg3 bg:color_bg1)\
[](fg:surface0 bg:base)\
$time\
[ ](fg:color_bg1)\
[ ](fg:base)\
$line_break$character"""
palette = "gruvbox_dark"
palette = "catppuccin_mocha"
[palettes.gruvbox_dark]
color_fg0 = "#fbf1c7"
color_bg1 = "#3c3836"
color_bg3 = "#665c54"
color_blue = "#458588"
color_aqua = "#689d6a"
color_green = "#98971a"
color_orange = "#d65d0e"
color_purple = "#b16286"
color_red = "#cc241d"
color_yellow = "#d79921"
# Official Catppuccin Mocha palette (catppuccin/starship themes/mocha.toml)
[palettes.catppuccin_mocha]
rosewater = "#f5e0dc"
flamingo = "#f2cdcd"
pink = "#f5c2e7"
mauve = "#cba6f7"
red = "#f38ba8"
maroon = "#eba0ac"
peach = "#fab387"
yellow = "#f9e2af"
green = "#a6e3a1"
teal = "#94e2d5"
sky = "#89dceb"
sapphire = "#74c7ec"
blue = "#89b4fa"
lavender = "#b4befe"
text = "#cdd6f4"
subtext1 = "#bac2de"
subtext0 = "#a6adc8"
overlay2 = "#9399b2"
overlay1 = "#7f849c"
overlay0 = "#6c7086"
surface2 = "#585b70"
surface1 = "#45475a"
surface0 = "#313244"
base = "#1e1e2e"
mantle = "#181825"
crust = "#11111b"
[os]
disabled = false
style = "bg:color_orange fg:color_fg0"
style = "bg:peach fg:crust"
[os.symbols]
Windows = "󰍲"
@ -72,12 +89,12 @@ Pop = ""
[username]
show_always = true
style_user = "bg:color_orange fg:color_fg0"
style_root = "bg:color_orange fg:color_fg0"
style_user = "bg:peach fg:crust"
style_root = "bg:peach fg:crust"
format = "[ $user ]($style)"
[directory]
style = "fg:color_fg0 bg:color_yellow"
style = "fg:crust bg:yellow"
format = "[ $path ]($style)"
truncation_length = 3
truncation_symbol = "…/"
@ -91,90 +108,90 @@ Developer = "󰲋 "
[git_branch]
symbol = ""
style = "bg:color_aqua"
format = "[[ $symbol $branch ](fg:color_fg0 bg:color_aqua)]($style)"
style = "bg:teal"
format = "[[ $symbol $branch ](fg:crust bg:teal)]($style)"
[git_status]
style = "bg:color_aqua"
format = "[[($all_status$ahead_behind )](fg:color_fg0 bg:color_aqua)]($style)"
style = "bg:teal"
format = "[[($all_status$ahead_behind )](fg:crust bg:teal)]($style)"
[nodejs]
symbol = ""
style = "bg:color_blue"
format = "[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)"
style = "bg:blue"
format = "[[ $symbol( $version) ](fg:crust bg:blue)]($style)"
[c]
symbol = " "
style = "bg:color_blue"
format = "[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)"
style = "bg:blue"
format = "[[ $symbol( $version) ](fg:crust bg:blue)]($style)"
[cpp]
symbol = " "
style = "bg:color_blue"
format = "[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)"
style = "bg:blue"
format = "[[ $symbol( $version) ](fg:crust bg:blue)]($style)"
[rust]
symbol = ""
style = "bg:color_blue"
format = "[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)"
style = "bg:blue"
format = "[[ $symbol( $version) ](fg:crust bg:blue)]($style)"
[golang]
symbol = ""
style = "bg:color_blue"
format = "[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)"
style = "bg:blue"
format = "[[ $symbol( $version) ](fg:crust bg:blue)]($style)"
[php]
symbol = ""
style = "bg:color_blue"
format = "[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)"
style = "bg:blue"
format = "[[ $symbol( $version) ](fg:crust bg:blue)]($style)"
[java]
symbol = ""
style = "bg:color_blue"
format = "[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)"
style = "bg:blue"
format = "[[ $symbol( $version) ](fg:crust bg:blue)]($style)"
[kotlin]
symbol = ""
style = "bg:color_blue"
format = "[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)"
style = "bg:blue"
format = "[[ $symbol( $version) ](fg:crust bg:blue)]($style)"
[haskell]
symbol = ""
style = "bg:color_blue"
format = "[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)"
style = "bg:blue"
format = "[[ $symbol( $version) ](fg:crust bg:blue)]($style)"
[python]
symbol = ""
style = "bg:color_blue"
format = "[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)"
style = "bg:blue"
format = "[[ $symbol( $version) ](fg:crust bg:blue)]($style)"
[docker_context]
symbol = ""
style = "bg:color_bg3"
format = "[[ $symbol( $context) ](fg:#83a598 bg:color_bg3)]($style)"
style = "bg:surface0"
format = "[[ $symbol( $context) ](fg:teal bg:surface0)]($style)"
[conda]
style = "bg:color_bg3"
format = "[[ $symbol( $environment) ](fg:#83a598 bg:color_bg3)]($style)"
style = "bg:surface0"
format = "[[ $symbol( $environment) ](fg:teal bg:surface0)]($style)"
[pixi]
style = "bg:color_bg3"
format = "[[ $symbol( $version)( $environment) ](fg:color_fg0 bg:color_bg3)]($style)"
style = "bg:surface0"
format = "[[ $symbol( $version)( $environment) ](fg:text bg:surface0)]($style)"
[time]
disabled = false
time_format = "%R"
style = "bg:color_bg1"
format = "[[  $time ](fg:color_fg0 bg:color_bg1)]($style)"
style = "bg:base"
format = "[[  $time ](fg:text bg:base)]($style)"
[line_break]
disabled = false
[character]
disabled = false
success_symbol = "[](bold fg:color_green)"
error_symbol = "[](bold fg:color_red)"
vimcmd_symbol = "[](bold fg:color_green)"
vimcmd_replace_one_symbol = "[](bold fg:color_purple)"
vimcmd_replace_symbol = "[](bold fg:color_purple)"
vimcmd_visual_symbol = "[](bold fg:color_yellow)"
success_symbol = "[](bold fg:green)"
error_symbol = "[](bold fg:red)"
vimcmd_symbol = "[](bold fg:green)"
vimcmd_replace_one_symbol = "[](bold fg:mauve)"
vimcmd_replace_symbol = "[](bold fg:mauve)"
vimcmd_visual_symbol = "[](bold fg:yellow)"

View file

@ -14,7 +14,15 @@
prefix = "C-a";
escapeTime = 0;
aggressiveResize = true;
plugins = [ { plugin = pkgs.tmuxPlugins.gruvbox; } ];
plugins = [
{
plugin = pkgs.tmuxPlugins.catppuccin;
extraConfig = ''
set -g @catppuccin_flavor "mocha"
set -g @catppuccin_window_status_style "rounded"
'';
}
];
extraConfig = ''
# Terminal configuration for proper colors and features
set-option -g default-terminal "screen-256color"
@ -50,9 +58,10 @@
bind J resize-pane -D 5
bind K resize-pane -U 5
bind L resize-pane -R 5
# Ensure tmux panes spawn login nu so Starship integration runs
set -g default-shell "${config.home.profileDirectory}/bin/nu"
set -g default-command "${config.home.profileDirectory}/bin/nu --login"
# Start Zsh by default and keep Nushell available on prefix + C-n.
set -g default-shell "/bin/zsh"
set -g default-command "/bin/zsh --login"
bind-key C-n new-window -n nushell "${config.home.profileDirectory}/bin/nu --login"
'';
};
}

136
modules/home/shell/zsh.nix Normal file
View file

@ -0,0 +1,136 @@
{ config, ... }:
{
programs.zsh = {
enable = true;
enableCompletion = true;
dotDir = config.home.homeDirectory;
oh-my-zsh = {
enable = true;
plugins = [
"git"
"sudo"
];
};
shellAliases.ssh = "kitten ssh";
profileExtra = ''
if [[ -x /opt/homebrew/bin/brew ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
elif [[ -x /usr/local/bin/brew ]]; then
eval "$(/usr/local/bin/brew shellenv)"
fi
[[ -r "$HOME/.orbstack/shell/init.zsh" ]] && source "$HOME/.orbstack/shell/init.zsh"
'';
initContent = ''
typeset -U path PATH
path=(
"$HOME/.cache/.bun/bin"
"$HOME/.local/bin"
$path
"$HOME/.lmstudio/bin"
)
export PATH
_load_global_secrets() {
local secret_dir="''${XDG_CONFIG_HOME:-$HOME/.config}/secrets/global-env"
local secret_file name value
[[ -d "$secret_dir" ]] || return 0
for secret_file in "$secret_dir"/*(N.); do
name="''${secret_file:t}"
[[ "$name" =~ '^[A-Za-z_][A-Za-z0-9_]*$' ]] || continue
value="$(<"$secret_file")"
export "$name=$value"
done
}
_load_global_secrets
unfunction _load_global_secrets
dotfiles-qa() (
local dotfiles_dir="${config.home.homeDirectory}/Development/dotfiles"
print -P "%F{green}Running dotfiles QA validation...%f"
cd "$dotfiles_dir" || return 1
print -P "%F{blue}1. Formatting Nix files...%f"
nix fmt . || {
print -P "%F{red}Formatting failed.%f"
return 1
}
print -P "%F{blue}2. Running flake checks...%f"
XDG_CACHE_HOME="$dotfiles_dir/.cache" nix flake check || {
print -P "%F{red}Flake checks failed.%f"
return 1
}
print -P "%F{blue}3. Building the Darwin configuration...%f"
darwin-rebuild build --flake "$dotfiles_dir#macbook-pro" || {
print -P "%F{red}Darwin build failed.%f"
return 1
}
print -P "%F{green}Core QA checks passed.%f"
)
bd-init() {
if [[ ! -d .git && ! -f .git ]]; then
print -P "%F{red}Error: not in a Git repository.%f"
print "Initialize one with: git init"
return 1
fi
if [[ -e .beads ]]; then
print -P "%F{yellow}Beads is already initialized in this project.%f"
return 0
fi
bd init || return
print -P "%F{green}Beads initialized.%f"
print "Next steps:"
print ' bd create --title "Your task" --type feature'
print " bd ready"
}
bd-ready() {
if [[ ! -e .beads ]]; then
print -P "%F{red}Not a Beads project. Run bd-init first.%f"
return 1
fi
local ready_tasks
ready_tasks="$(bd ready --json)" || return
if [[ "$(print -r -- "$ready_tasks" | jq 'length')" == 0 ]]; then
print -P "%F{yellow}No ready tasks.%f"
return 0
fi
print -P "%F{green}Ready tasks:%f"
print -r -- "$ready_tasks" | jq -r '
.[] |
"[\(.id)] \(.title)\n Type: \(.type) | Priority: \(.priority) | Status: \(.status)" +
(if ((.description // "") | length) > 0 then "\n \(.description)" else "" end) +
"\n"
'
}
bd-sync() {
if [[ ! -e .beads ]]; then
print -P "%F{red}Not a Beads project.%f"
return 1
fi
print -P "%F{blue}Syncing Beads database...%f"
bd sync || return
print -P "%F{green}Sync complete.%f"
}
'';
};
}