alias cp='cp -iv' alias rm='rm -iv' alias mv='mv -iv' # Git alias lg='lazygit' alias gs='git status' alias ga='git add' alias gb='git branch' alias gc='git commit' alias gd='git diff' alias go='git checkout' alias gl='git log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short' # Nixos alias ras='sudo nixos-rebuild switch --flake .#' # Tmux tm() { if [ -n "$1" ]; then # If an argument is provided, try to attach to it or create it. tmux attach-session -t "$1" 2>/dev/null || tmux new-session -s "$1" elif tmux has-session 2>/dev/null; then # No argument? Open the alphabetical list. tmux attach-session \; choose-tree -sZ -O name else # Nothing running? Fresh start. tmux fi } # Edit NixOS Sops secret files. se() { local SYSTEM=$1 local REPO_ROOT="$HOME/.nixos" local SECRET_PATH="$REPO_ROOT/systems/$SYSTEM/secrets/secrets.yaml" if [ -z "$SYSTEM" ]; then echo "Usage: se (e.g., se suliman)" return 1 fi if [ ! -f "$SECRET_PATH" ]; then echo "Error: Secret file not found at $SECRET_PATH" echo "Creating new secret file for $SYSTEM..." mkdir -p "$(dirname "$SECRET_PATH")" fi nix shell nixpkgs#sops -c sops "$SECRET_PATH" }