Introduce gh-token function and ght alias to extract gh_repo_token from SOPS-managed Homelab secrets directly into the Wayland clipboard via wl-copy -n --sensitive. - Add home/shell/secrets.sh with gh-token function - Source secrets.sh and register ght alias in home/shell.nix - Update docs/reference/shell.md to document secrets.sh and ght
2.9 KiB
2.9 KiB
🐚 Shell & CLI Environment Reference
This document catalogs the interactive Bash shell configuration, Starship prompt integration, and custom helper scripts managed in home/shell.nix and home/shell/.
1. Shell Configuration Architecture
The shell environment is modularized:
home/shell.nix: Core Home Manager bash module, aliases, environment exports, and tool integrations (Direnv, Starship, Fastfetch).home/shell/: Domain-specific sourced shell scripts:git.sh: Git helper functions and branch utilities.jump.sh: Directory navigation and quick jumping.pdf.sh: PDF compilation, viewing, and OCR helpers.quicklinks.sh: Shortcuts to primary project directories.secrets.sh: SOPS secret retrieval and Wayland clipboard extraction (gh-token).todo.sh: Lightweight terminal task tracking.wayland.sh: Wayland session environment variables and clipboard helpers.
2. Shell Aliases & Shortcuts
System & Navigation
| Alias | Target Command | Purpose |
|---|---|---|
c |
clear |
Clear terminal scrollback. |
q |
exit |
Close shell session. |
ls |
eza --icons |
Modern directory listing. |
ll |
eza -la --icons |
Detailed directory listing. |
tree |
eza --tree --icons |
Directory tree visualization. |
cat |
bat --paging=never |
Syntax-highlighted file viewing. |
Git & Workflows
| Alias | Target Command | Purpose |
|---|---|---|
gs |
git status |
Quick working tree status. |
gd |
git diff |
Syntax-highlighted git diff via Delta. |
gl |
git log --oneline --graph --decorate |
Compact visual commit graph. |
ght |
gh-token |
Copy GitHub repo token from SOPS into Wayland clipboard. |
Directory Navigation Jumps (home/shell/jump.sh)
| 2-Letter | Word Alias | Target Directory | Description |
|---|---|---|---|
br |
brain |
~/Brain |
Second brain knowledge base. |
cf |
conf / cfg |
~/Config |
Declarative NixOS configuration. |
dc |
doc / docs |
~/Documents |
Personal documents. |
dl |
dl |
~/Downloads |
Downloads folder. |
pi |
pic / pict |
~/Pictures |
Wallpapers, images, screenshots. |
pj |
pj / prj |
~/Projects |
Local workspace for project repositories. |
hl |
hl / homelab |
~/Homelab |
Local workspace for homelab repositories. |
3. Modular Shell Scripts (home/shell/)
All files in home/shell/*.sh are automatically sourced during interactive bash startup:
for script in ~/.config/bash/*.sh; do
[ -r "$script" ] && source "$script"
done
Adding a New Shell Extension
To add new bash functions or aliases:
- Create a new
.shfile underhome/shell/<topic>.sh. - Add the source link in
home/shell.nix:home.file.".config/bash/<topic>.sh".source = ./shell/<topic>.sh; - Rebuild and restart the shell.