wihan/dev

configs

The relevant configs

The dotfiles live in the machine flake and deploy on rebuild; there are exactly two, which is the point. Plus the Factorio server compose file and the CS2 configs. Hover a block for the copy button and take what you need.

# The live file from the machine flake, symlinked into $HOME.
export PATH="$HOME/.local/bin:$HOME/.bun/bin:$HOME/go/bin:$PATH"

# History: shared across sessions, duplicates dropped, a leading space
# keeps a command out of the file.
HISTSIZE=100000
SAVEHIST=100000
setopt share_history hist_ignore_all_dups hist_ignore_space hist_reduce_blanks

# Native build deps for Rust crates with C dependencies (openssl-sys, etc.).
export OPENSSL_NO_VENDOR=1
export PKG_CONFIG_PATH="/run/current-system/sw/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"

# LD_LIBRARY_PATH for unpatched binaries that dlopen shared libs at
# runtime. /etc/runtime-libs is a curated two-library directory; do NOT
# point this at the whole system profile. LD_LIBRARY_PATH outranks
# RPATH, so the system profile would shadow whatever a nix binary was
# actually built against.
export LD_LIBRARY_PATH="/etc/runtime-libs${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"

# Catppuccin zsh-syntax-highlighting theme (deployed by the rebuild)
[ -f "$HOME/.config/zsh/catppuccin_mocha-zsh-syntax-highlighting.zsh" ] && \
  source "$HOME/.config/zsh/catppuccin_mocha-zsh-syntax-highlighting.zsh"

# FZF catppuccin mocha colors
export FZF_DEFAULT_OPTS=" \
  --color=bg+:#313244,bg:#1e1e2e,spinner:#f5e0dc,hl:#f38ba8 \
  --color=fg:#cdd6f4,header:#f38ba8,info:#cba6f7,pointer:#f5e0dc \
  --color=marker:#b4befe,fg+:#cdd6f4,prompt:#cba6f7,hl+:#f38ba8 \
  --color=selected-bg:#45475a \
  --multi"

# Tools
eval "$(zoxide init zsh --cmd cd)"

# fzf keybindings: ctrl-r history search, ctrl-t file picker, alt-c cd.
source <(fzf --zsh)

# devenv auto-activation: cd into a project with devenv.nix and drop
# into its shell. Guarded: dotfiles deploy by symlink on save, but the
# devenv binary only lands on PATH after a rebuild.
command -v devenv >/dev/null && eval "$(devenv hook zsh)"

# ESP32 Xtensa toolchain, generated by espup install.
[ -f "$HOME/export-esp.sh" ] && . "$HOME/export-esp.sh"

# Aliases
alias ls="eza --tree --level 1 --icons=always"
alias vim="nvim"
alias cat="bat"

alias fbranch='git branch | cut -c 3- | gum filter | xargs -I {} git switch {}'
alias ccbranch='git branch | grep "*" | cut -c 3- | tr -d "\n" | wl-copy'
alias dbranch='git branch | cut -c 3- | gum choose --no-limit | xargs -I {} git branch -D {}'
alias fuckit="git reset --hard HEAD"

alias ngrok="op plugin run -- ngrok"

# Fun (only tools that are actually installed)
alias aquarium="asciiquarium"
alias wisdom="fortune | cowsay"

# Functions
intj() { idea "${1:-.}" &>/dev/null &disown; }
use-java() { nix shell "nixpkgs#temurin-bin-${1}" -c "$SHELL"; }

# Prompt (must be last)
eval "$(starship init zsh)"