1 line
10 KiB
JSON
1 line
10 KiB
JSON
{"repo": "0xgurg/dotfiles", "files": {"README.md": {"eb0b2f90244bb8dfbb2c07eff12f50894ff2d41b": {"t": 1785846944.4106445, "n": 9802, "h": "5c7c6c4ef15b5e9f", "c": "# Dotfiles\n\nPersonal configuration files for macOS and Arch Linux, managed with GNU Stow.\n\n## 📁 Structure\n\n```\n~/dotfiles/\n├── .zshrc # Zsh shell config (stowed to ~/.zshrc)\n├── .zprofile # Login shell startup (fastfetch runs here)\n├── Brewfile # Homebrew packages (macOS)\n├── .config/ # XDG config directory (stowed to ~/.config/)\n│ ├── bigkis/ # Arch Linux package declarations (pacman/AUR/flatpak/node)\n│ │ └── system.toml\n│ ├── starship/ # Starship prompt\n│ │ └── starship.toml\n│ ├── git/ # Git configuration\n│ │ └── config\n│ ├── hypr/ # Hyprland window manager (Arch)\n│ ├── aerospace/ # Window manager (macOS)\n│ ├── atuin/ # Shell history database\n│ ├── btop/ # System monitor\n│ ├── fastfetch/ # System info\n│ ├── ghostty/ # Terminal emulator + themes\n│ ├── nvim/ # Neovim editor (see .config/nvim/README.md)\n│ ├── opencode/ # OpenCode config\n│ ├── raycast/ # Raycast launcher (macOS)\n│ └── sketchybar/ # macOS status bar\n└── scripts/ # Setup and utility scripts\n ├── setup.sh # Bootstrap script (macOS + Arch)\n ├── sbctl-setup.sh # Secure Boot — Part 1: generate keys (Arch)\n ├── sbctl-sign.sh # Secure Boot — Part 2: enroll + sign (Arch)\n ├── nvhc.sh # Cursor + Neovim split workflow (macOS)\n └── enable-touchid-sudo.sh\n```\n\n## 🚀 Quick Start\n\n### 1. Clone Repository\n```bash\ngit clone <repository-url> ~/dotfiles\ncd ~/dotfiles\n```\n\n### 2. Run Setup Script\n```bash\nchmod +x scripts/setup.sh\n./scripts/setup.sh\n```\n\nThe script auto-detects your OS and handles everything:\n\n| Step | macOS | Arch Linux |\n|------|-------|------------|\n| Package manager | Homebrew | bigkis (pacman + AUR + flatpak + node) |\n| Symlinks | `stow .` | `stow .` (macOS-only configs ignored) |\n| Default shell | — (zsh is default) | `chsh` to zsh |\n| NVIDIA Early KMS | — | `mkinitcpio.conf` + systemd-boot param |\n| Auth | Touch ID for sudo | Howdy (facial recognition) |\n\n### 3. Restart Terminal\n```bash\nsource ~/.zshrc\n# or just open a new terminal\n```\n\n---\n\n## 🔒 Arch Linux — Secure Boot Setup\n\nSecure Boot requires a manual BIOS step so it is handled by two separate scripts, run **after** `setup.sh` completes.\n\n### Part 1 — Generate keys (before BIOS)\n```bash\n./scripts/sbctl-setup.sh\n```\nThis runs `sbctl status`, creates your signing keys, then prompts you to reboot.\n\n### BIOS step (manual)\n1. Enter your BIOS/UEFI firmware (Del, F2, or F12 on boot)\n2. Navigate to **Secure Boot** settings\n3. **Delete / clear all existing Secure Boot keys** — this puts the firmware into *Setup Mode*\n4. Save and boot back into Arch Linux\n\n### Part 2 — Enroll keys & sign EFI binaries (after BIOS)\n```bash\n./scripts/sbctl-sign.sh\n```\nThis enrolls your keys (including Microsoft keys with `-m` for hardware compatibility), discovers all unsigned EFI binaries via `sbctl verify`, signs each one with `sbctl sign -s` (the `-s` flag saves paths for automatic re-signing on kernel updates), and reboots to activate Secure Boot.\n\n## 🔧 Tools\n\n| Tool | Purpose | Platform |\n|------|---------|----------|\n| **Neovim** | Code editor (TypeScript/JS focus) | Both |\n| **Zsh** | Shell with autosuggestions & syntax highlighting | Both |\n| **Starship** | Fast, customizable prompt | Both |\n| **Ghostty** | GPU-accelerated terminal emulator | Both |\n| **Lazygit** | Terminal UI for git | Both |\n| **Zoxide** | Smart directory jumper (`z`, `zi`) | Both |\n| **Atuin** | Shell history database with sync | Both |\n| **Ollama** | Local LLM runner | Both |\n| **OpenCode** | AI coding assistant (shared OpenCode Go account) | Both |\n| **AeroSpace** | Window tiling manager | macOS |\n| **SketchyBar** | Custom macOS status bar | macOS |\n| **Hyprland** | Wayland compositor / tiling WM | Arch |\n| **bigkis** | Declarative package manager (pacman/AUR/flatpak/node) | Arch |\n| **UFW** | Firewall | Arch |\n| **sbctl** | Secure Boot key management | Arch |\n\n## 🔗 Symlink Management with Stow\n\n### Create Symlinks\n```bash\ncd ~/dotfiles\nstow .\n```\n\n### Remove Symlinks\n```bash\ncd ~/dotfiles\nstow -D .\n```\n\n### Restow (useful after adding new files)\n```bash\ncd ~/dotfiles\nstow -R .\n```\n\n## 📦 Package Management\n\n### Update Everything\n```bash\npkgup\n```\n\nOn macOS this runs `brew update && brew bundle install && brew upgrade`.\nOn Arch it runs `bigkis apply` (pacman + AUR + flatpak + node).\n\n### macOS — Add New Package\nEdit `Brewfile` and run `pkgup`.\n\n### Arch — Add New Package\nEdit `bigkis/system.toml` and run `pkgup`.\n\n### Arch — Migrating an Existing Box Into bigkis\nOn a **fresh Arch install**, just run `setup.sh` — it applies `system.toml` as-is.\n\nOn a **long-lived Arch box** that already has packages installed outside bigkis,\nseed a starter config from the current system once before adopting bigkis:\n\n```bash\nbigkis import > ~/.config/bigkis/system.toml\n# Review/prune the generated file, then commit it to dotfiles.\n```\n\nAfter that, the normal `pkgup` flow takes over. `bigkis import` is **not** part of\nthe fresh-install bootstrap — it's a one-time seed for migration.\n\nTo detect packages installed ad-hoc later (drift), use `bigkis status` (which\n`setup.sh` already runs as a post-flight check).\n\n## 🎨 Customization\n\n### Shell Configuration\nEdit `.zshrc` for:\n- Aliases\n- Functions \n- Environment variables\n- Key bindings\n\nThen reload:\n```bash\nsz # alias for: source ~/.zshrc\n```\n\n### Starship Prompt\nEdit `.config/starship/starship.toml` to customize the prompt theme.\n\n### Git Configuration\nEdit `.config/git/config` for user settings.\n\n## ⌨️ Key Aliases\n\n| Alias | Command |\n|-------|---------|\n| `pkgup` | Update all packages (brew on macOS, bigkis on Arch) |\n| `sz` | Reload shell config |\n| `nv` | Open neovim |\n| `nvh` | Open neovim in current dir |\n| `nvhc` | Cursor + Neovim split layout |\n| `lg` | Open lazygit |\n| `ff` | Show system info (fastfetch) |\n| `z <dir>` | Smart cd (zoxide) |\n| `zi` | Interactive directory picker |\n\n## 🔄 Maintenance\n\n### Reload Configs\n```bash\n# Shell\nsz\n\n# SketchyBar\nsketchybar --reload\n\n# AeroSpace\naerospace reload-config\n\n# Neovim\n# Restart or :Lazy sync\n```\n\n## 🔐 Touch ID for sudo (macOS)\n\nEnable fingerprint authentication instead of password prompts in terminals:\n\n```bash\n./scripts/enable-touchid-sudo.sh\n```\n\nOr run during initial setup (prompted automatically).\n\n## 🔑 Secrets & Environment Variables\n\nSecrets are stored in `.env` (gitignored). Copy the template on first setup:\n\n```bash\ncp .env.tmpl .env\n$EDITOR .env\n```\n\nOr fill them automatically from Bitwarden:\n\n```bash\npython3 scripts/inject-secrets.py\n```\n\n| Variable | Purpose |\n|----------|---------|\n| `OPENCODE_GO_WORKSPACE_ID_PRIMARY` | Primary OpenCode Go workspace ID for quota tracking |\n| `OPENCODE_GO_WORKSPACE_ID_SECONDARY` | Secondary OpenCode Go workspace ID (optional second account) |\n| `OPENCODE_GO_API_KEY_PRIMARY` | Primary OpenCode Go API key (`/workspace/<id>/keys`) |\n| `OPENCODE_GO_API_KEY_SECONDARY` | Secondary OpenCode Go API key |\n| `BRAVE_API_KEY` | Brave Search API key (used by OpenCode Librarian agent) |\n| `SANITY_AUTH_TOKEN` | Sanity CMS authentication |\n\n> **Note:** The OpenCode Go auth cookie is **not** in `.env`. It's stored in\n> `~/.config/opencode/opencode-quota/opencode-go.json` (gitignored) and managed\n> by the refresh script — see below.\n\n## 🤖 OpenCode Go Setup\n\nThis repo includes a shared [OpenCode](https://opencode.ai) configuration with the\n[oh-my-opencode-slim](https://github.com/oh-my-opencode/oh-my-opencode-slim) agent\norchestration plugin and [opencode-quota](https://github.com/slkiser/opencode-quota)\nfor usage tracking.\n\n### Auth Cookie\n\nOpenCode Go requires an auth cookie for quota tracking. To set it up or refresh it:\n\n```bash\nocgo\n```\n\nThis extracts the `auth` cookie from your browser and saves it to\n`opencode-quota/opencode-go.json`. Run it again when the cookie expires.\n\n**Two accounts:** workspace IDs and API keys live in `.env`. Switching with\n`ocgo-primary` / `ocgo-secondary` updates quota config **and** the OpenCode Go\nprovider key in `~/.local/share/opencode/auth.json`. Dashboard cookies are saved\nper account under `opencode-quota/accounts/`.\n\n```bash\nocgo-primary # refresh + switch to primary + show quota\nocgo-secondary # refresh + switch to secondary + show quota\nocgo-status # check both accounts\nocgo switch primary # switch only (no browser refresh)\n```\n\nLog into the target account before running `ocgo-primary` (Brave) or\n`ocgo-secondary` (Chrome) if the cookie needs refreshing.\n\n| Flag / command | Purpose |\n|------|---------|\n| `primary`, `secondary`, `ocgo-primary`, `ocgo-secondary` | Refresh if needed, switch quota + provider API key, show quota |\n| `--check` | Check if current cookie is valid without refreshing |\n| `--force` | Force refresh even if the cookie is still valid |\n| `--account primary\\|secondary` | Target a specific account for refresh/check |\n| `switch primary\\|secondary` | Activate a saved cookie without browser refresh |\n| `status`, `ocgo-status` | Check status of both accounts |\n\n## 📝 Notes\n\n- **Tested on**: Apple Silicon Macs (M1/M2/M4) and Arch Linux (Intel + NVIDIA)\n- **XDG Base Directory**: Follows `~/.config` standard\n- **Stow-based**: Uses GNU Stow for symlink management\n- **Git-tracked**: All configs versioned for easy restoration\n- **Shared account**: OpenCode Go is shared — use `/quota` in OpenCode to check usage\n- **Cross-OS configs** are harmless since applications only read their own configuration files\n\n## 📖 Detailed Documentation\n\n- **[Neovim](.config/nvim/README.md)** - Complete LSP setup, keymaps, plugins\n\n---\n\n**For tool-specific documentation, see the README in each folder (e.g., `nvim/README.md`)**\n"}}}} |