From f9342dc8e65c517de152e454c6e44ccd63453f8e Mon Sep 17 00:00:00 2001 From: kiskaadee Date: Mon, 14 Sep 2026 10:48:42 -0500 Subject: [PATCH] docs: refine DMS IPC terminology, reproducibility invariants, and tmux prefix --- README.md | 4 +-- architecture.md | 2 +- docs/configuration.md | 6 ++++ docs/desktop.md | 53 +++++++++++++++++++-------------- docs/getting-started.md | 21 +++++++++---- docs/reference/tmux.md | 65 ++++++++++++++++++++++++++++------------- 6 files changed, 99 insertions(+), 52 deletions(-) diff --git a/README.md b/README.md index 644b5b9..24e844d 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ For bootstrapping, key generation, and decryption workflows, consult the [Secret ## 🚀 Quick Start / Deployment ### 1. Installation & Bare-Metal Recovery -For fresh machine setup and disaster recovery, follow the [Getting Started & Disaster Recovery Runbook](docs/getting-started.md). +For fresh machine setup and disaster recovery, follow the [Getting Started: Fresh Installation & Recovery Runbook](docs/getting-started.md). ```bash git clone https://github.com/kiskaadee/nixos-config.git ~/Config @@ -124,7 +124,7 @@ sudo nixos-rebuild switch --flake ~/Config#laptop ## 📚 Workstation Operations Manual -* [Getting Started & Disaster Recovery](docs/getting-started.md) — Bare-metal install, partition scheme, hardware config, and desktop bootstrap. +* [Getting Started: Fresh Installation & Recovery](docs/getting-started.md) — Bare-metal install, reference partitioning, hardware config, and desktop bootstrap. * [Adding Software](docs/adding-software.md) — Decision tree for package placement, `home.packages` vs `programs.foo`, and unfree packages. * [Configuration Workflow](docs/configuration.md) — Day-to-day editing, dry-build validation, testing, and dotfiles management. * [System Lifecycle & Rebuilds](docs/system-lifecycle.md) — Nix rebuild pipeline, generations, bootloader rollback, and garbage collection. diff --git a/architecture.md b/architecture.md index 2629ecc..f7add31 100644 --- a/architecture.md +++ b/architecture.md @@ -4,7 +4,7 @@ This repository manages a purely declarative NixOS and Home Manager configuration for a standalone mobile workstation host (`laptop`). -1. **Git is the Source of Truth for Configuration**: Every persistent configuration decision intended to be reproducible is declaratively defined within this repository. Dynamic runtime state (SSH host private keys, machine-id, user application state, caches, browser profiles, and Docker volumes) lives outside the declarative boundary. +1. **Declarative System State vs. Mutable Runtime State**: Reproducibility in this repository means **reproducible declared system state**, not necessarily byte-for-byte reproducible runtime/user state. The workstation is **declaratively reproducible, with an explicitly documented desktop bootstrap state**. Dynamic runtime state (SSH host private keys, machine-id, DMS runtime settings and monitor layouts, browser profiles, caches, and Docker volumes) lives outside the declarative boundary. A runtime-mutated file must never be converted into a Home Manager-managed file merely because it is important or because tracking it in Git would appear to improve reproducibility. 2. **Domain-Driven Cohesion**: Configuration is organized by functional domain (`core`, `hardware`, `desktop`, `dev`, `shell`) rather than artificial multi-machine abstractions. 3. **Privilege Boundary Separation**: - **`system/` (Root/NixOS)**: Governs hardware, kernel, bootloader, base OS daemons, and system-level compositor enablement. diff --git a/docs/configuration.md b/docs/configuration.md index 4885752..03a3c60 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -79,6 +79,12 @@ Used for tools that provide their own GUI settings editor or dynamic state: These directories are **deliberately unmanaged by Home Manager**. They are modified interactively through their respective applications without interference from `nixos-rebuild switch`. +> [!IMPORTANT] +> **Repository Principle: Declared Reproducibility vs. Runtime State** +> Reproducibility in this repository means **reproducible declared system state**, not necessarily byte-for-byte reproducible runtime user state. The workstation is **declaratively reproducible, with an explicitly documented desktop bootstrap state**. +> +> A runtime-mutated file must never be converted into a Home Manager-managed store symlink merely because it is important or because tracking it in Git would appear to improve reproducibility. Doing so fights the application's runtime mutation model and causes permission errors or broken symlinks. + --- ## 4. Git Hygiene & Pre-Commit Checks diff --git a/docs/desktop.md b/docs/desktop.md index 876295f..24a5f9f 100644 --- a/docs/desktop.md +++ b/docs/desktop.md @@ -26,7 +26,7 @@ graph TD end subgraph "DMS Runtime State (Mutable)" - DMS --> BINDS["~/.config/niri/dms/binds.kdl
(Baseline & GUI shortcuts)"] + DMS --> BINDS["~/.config/niri/dms/binds.kdl
(DMS-managed Niri IPC bindings)"] DMS --> SETTINGS["~/.config/DankMaterialShell/settings.json
(Panels, widgets, themes)"] DMS --> DYN["~/.config/niri/dms/outputs.kdl & colors.kdl
(Monitors, Matugen theme)"] end @@ -44,19 +44,22 @@ A critical architectural invariant is respecting the distinction between **decla | :--- | :--- | :--- | :--- | :--- | | **Declarative Core** | `home/config/niri/config.kdl`
`home/config/niri/custom.kdl` | **Yes** | Immutable store symlinks | Governs compositor rules, gesture bindings, and personal shortcuts. | | **System Daemon** | `system/desktop.nix` | **Yes** | Immutable NixOS module | Enables Niri, DMS package, Greetd greeter, fonts. | -| **DMS Keybindings** | `~/.config/niri/dms/binds.kdl` | **No** (Seeded) | Mutable (`0644`) | Initialized via `dms setup binds`. Editable in DMS Settings GUI. | +| **DMS Niri IPC Bindings** | `~/.config/niri/dms/binds.kdl` | **No** (Bootstrap-owned) | Mutable (`0644`) | Initialized via `dms setup binds`. Bridges Niri to DMS runtime controls; editable via GUI/CLI. | | **DMS UI Preferences** | `~/.config/DankMaterialShell/settings.json` | **No** | Mutable | Stores user's bar widget selections, padding, and corner radius. | | **Display Outputs** | `~/.config/niri/dms/outputs.kdl` | **No** | Dynamic runtime | Generated by DMS when external displays are connected/repositioned. | | **Color Schemes** | `~/.config/niri/dms/colors.kdl` | **No** | Dynamic runtime | Extracted by Matugen from the active wallpaper. | +> [!IMPORTANT] +> `binds.kdl` is not part of the declarative workstation configuration. It is a bootstrap-owned artifact whose initial contents are established by `dms setup binds`. It serves as the bridge between Niri and DMS's runtime controls (the DMS-managed Niri IPC integration bindings). An empty or missing file disconnects a substantial portion of the desktop's control surface. + > [!CAUTION] -> Do not attempt to manage `~/.config/niri/dms/` or `~/.config/DankMaterialShell/settings.json` via Home Manager symlinks. Doing so breaks DMS's runtime ability to persist display changes, theme updates, and interactive settings. +> Do not attempt to manage `~/.config/niri/dms/` or `~/.config/DankMaterialShell/settings.json` via Home Manager store symlinks. Doing so breaks DMS's runtime ability to persist display changes, theme updates, and interactive settings. --- -## 3. Desktop Initialization (Fresh Install) +## 3. Desktop Initialization (Fresh User Profile) -On a fresh machine or new user profile, seed the baseline mutable keybindings with: +On a fresh user profile (or after recreating `$HOME`), initialize the mutable baseline keybindings with: ```bash dms setup binds @@ -68,41 +71,47 @@ This ensures `~/.config/niri/dms/binds.kdl` is created with proper user write pe ## 4. Master Shortcut Reference +> [!NOTE] +> **Precedence Rule**: In `config.kdl`, `include "custom.kdl"` is evaluated *after* `include optional=true "dms/binds.kdl"`. Where key definitions collide, `custom.kdl` overrides DMS defaults. Specifically: +> - `Mod+O` launches Obsidian (overriding DMS's secondary overview shortcut; toggle overview via `Mod+Tab`). +> - `Mod+W` triggers area screen recording (overriding DMS's column tabbed display toggle). + ### Core Applications & Session -| Shortcut | Action | Scope | -| :--- | :--- | :--- | -| `Mod+Return` | Open Alacritty Terminal | Custom (`custom.kdl`) | -| `Mod+T` | Open Terminal | DMS Default (`binds.kdl`) | -| `Mod+B` | Launch Firefox Browser | Custom (`custom.kdl`) | -| `Mod+O` | Launch Obsidian Notes | Custom (`custom.kdl`) | -| `Mod+Space` / `Alt+Space` | Toggle Spotlight Application Launcher | DMS IPC (`binds.kdl`) | -| `Mod+V` | Toggle Clipboard Manager | DMS IPC (`binds.kdl`) | -| `Mod+M` | Toggle Task Manager / Process List | DMS IPC (`binds.kdl`) | -| `Super+X` | Toggle Power Menu (Lock / Suspend / Shutdown) | DMS IPC (`binds.kdl`) | -| `Mod+Comma` | Open DMS Settings Modal | DMS IPC (`binds.kdl`) | -| `Mod+Tab` / `Mod+O` | Toggle Niri Column Overview | DMS IPC (`binds.kdl`) | -| `Mod+Shift+E` | Quit Niri Session | Niri Native (`binds.kdl`) | +| Shortcut | Action | Source | Precedence Note | +| :--- | :--- | :--- | :--- | +| `Mod+Return` | Open Alacritty Terminal | Custom (`custom.kdl`) | Primary workstation terminal. | +| `Mod+T` | Open Terminal | DMS IPC (`binds.kdl`) | Alternative terminal launcher. | +| `Mod+B` | Launch Firefox Browser | Custom (`custom.kdl`) | Browser shortcut. | +| `Mod+O` | Launch Obsidian Notes | Custom (`custom.kdl`) | Overrides DMS `Mod+O` overview. | +| `Mod+Tab` | Toggle Niri Column Overview | DMS IPC (`binds.kdl`) | Primary overview trigger. | +| `Mod+Space` / `Alt+Space` | Toggle Spotlight Application Launcher | DMS IPC (`binds.kdl`) | DMS app launcher modal. | +| `Mod+V` | Toggle Clipboard Manager | DMS IPC (`binds.kdl`) | DMS clipboard history modal. | +| `Mod+M` | Toggle Task Manager / Process List | DMS IPC (`binds.kdl`) | DMS process manager. | +| `Super+X` | Toggle Power Menu (Lock / Suspend / Shutdown) | DMS IPC (`binds.kdl`) | DMS session menu. | +| `Mod+Comma` | Open DMS Settings Modal | DMS IPC (`binds.kdl`) | Interactive desktop settings. | +| `Mod+Shift+E` | Quit Niri Session | Niri Native (`binds.kdl`) | Exits Wayland compositor. | ### Window Management & Resizing -| Shortcut | Action | Scope | +| Shortcut | Action | Source | | :--- | :--- | :--- | | `Mod+Q` | Close Active Window | DMS IPC (`binds.kdl`) | | `Mod+Shift+Q` | Force Kill Focused Window Process (`kill -9`) | Custom (`custom.kdl`) | | `Mod+F` | Maximize Focused Column | DMS IPC (`binds.kdl`) | | `Mod+Shift+F` | Fullscreen Window | DMS IPC (`binds.kdl`) | | `Mod+Shift+T` | Toggle Window Floating | DMS IPC (`binds.kdl`) | -| `Mod+W` | Toggle Column Tabbed Display | DMS IPC (`binds.kdl`) | +| `Mod+Shift+W` | Create DMS Window Rule | DMS IPC (`binds.kdl`) | | `Mod+Alt+Right / Left` | Expand / Shrink Column Width (+/- 100px) | Custom (`custom.kdl`) | | `Mod+Alt+Down / Up` | Expand / Shrink Window Height (+/- 100px) | Custom (`custom.kdl`) | ### Screenshots, Screen Recording & Utilities -| Shortcut | Action | Scope | +| Shortcut | Action | Source | | :--- | :--- | :--- | | `Mod+S` | Interactive Area Screenshot | Custom (`custom.kdl`) | | `Mod+Shift+S` | Screenshot Active Window | Custom (`custom.kdl`) | | `Mod+Alt+S` | Screenshot Full Screen | Custom (`custom.kdl`) | -| `Mod+W` | Record Selected Screen Area (wf-recorder) | Custom (`custom.kdl`) | +| `Mod+W` | Record Selected Screen Area (wf-recorder) | Custom (`custom.kdl`, overrides tabbed column) | | `Mod+Shift+W` | Record Focused Monitor | Custom (`custom.kdl`) | | `Mod+Ctrl+W` | Record Selected Area + Audio | Custom (`custom.kdl`) | +| `Mod+Ctrl+Shift+W` | Record Focused Monitor + Audio | Custom (`custom.kdl`) | | `Mod+Shift+C` | Eyedropper Color Picker (copies HEX to clipboard) | Custom (`custom.kdl`) | | `Mod+Ctrl+Shift+R` | Hot-Reload Niri Configuration | Custom (`custom.kdl`) | diff --git a/docs/getting-started.md b/docs/getting-started.md index f3484a9..5e7e33d 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -1,6 +1,6 @@ -# 🚀 Getting Started & Disaster Recovery +# 🚀 Getting Started: Fresh Installation & Recovery -This document is the operational procedure for bootstrapping the workstation host (`laptop`) from bare metal or recovering after a catastrophic drive failure. +This document is the operational procedure for bootstrapping the workstation host (`laptop`) from bare metal or recovering after a drive replacement. --- @@ -17,6 +17,10 @@ This document is the operational procedure for bootstrapping the workstation hos ## 2. Disk Partitioning & Mounting +> [!NOTE] +> **Example Reference Partitioning Layout** +> The following partitioning recipe is a standard reference layout for a clean NVMe drive. If recovering an existing drive, or using Btrfs, ZFS, or LUKS encryption, adjust partition identifiers and mount existing subvolumes/filesystems accordingly. The actual filesystem UUIDs and mount options will be captured into `system/hardware-configuration.nix` in the next step. + Assuming NVMe target drive `/dev/nvme0n1`: ```bash @@ -82,15 +86,20 @@ reboot 3. Open a terminal (`Mod+Return`). ### Desktop Initialization Phase -On a fresh machine, DMS requires a one-time setup command to seed its mutable baseline keybindings: +On a fresh user profile (or after recreating `$HOME`), initialize DMS's mutable baseline keybindings with: ```bash dms setup binds ``` -This generates `~/.config/niri/dms/binds.kdl` with standard user write permissions (`0644`). From this point forward: -- Niri loads all standard DMS IPC shortcuts (`Mod+Space` for spotlight launcher, `Mod+V` for clipboard, `Mod+M` for task manager, `Super+X` for power menu, volume and brightness controls). -- DMS owns, updates, and mutates `~/.config/niri/dms/` and `~/.config/DankMaterialShell/settings.json` without conflicting with the declarative Nix store. +This generates `~/.config/niri/dms/binds.kdl` with standard user write permissions (`0644`). + +> [!IMPORTANT] +> `binds.kdl` is not part of the declarative workstation configuration. It is a bootstrap-owned artifact whose initial contents are established by `dms setup binds`, establishing the DMS-managed Niri IPC integration bindings. Subsequent edits via the DMS Settings GUI or CLI mutate this file directly. +> +> From this point forward: +> - Niri loads all standard DMS IPC shortcuts (`Mod+Space` for spotlight launcher, `Mod+V` for clipboard, `Mod+M` for task manager, `Super+X` for power menu, volume and brightness controls). +> - DMS owns, updates, and mutates `~/.config/niri/dms/` and `~/.config/DankMaterialShell/settings.json` without conflicting with the declarative Nix store. --- diff --git a/docs/reference/tmux.md b/docs/reference/tmux.md index d68f156..5c3c9e6 100644 --- a/docs/reference/tmux.md +++ b/docs/reference/tmux.md @@ -1,42 +1,65 @@ # 🪟 Tmux Reference & Workflow -This document describes the Tmux terminal multiplexer configuration declared in `home/shell.nix` and `home/config/tmux/tmux.conf`. +This document describes the Tmux terminal multiplexer configuration declared in `home/shell.nix` and `home/config/tmux.conf`. --- ## 1. Core Configuration -- **Prefix Key**: `Ctrl+A` (remapped from standard `Ctrl+B`). -- **Terminal Capabilities**: TrueColor (`tmux-256color`) with RGB support. +- **Prefix Key**: `Ctrl+Space` (`C-Space`, remapped from standard `Ctrl+B`). +- **Terminal Capabilities**: TrueColor (`tmux-256color`) with RGB support and extended keys enabled. - **Mouse Support**: Enabled for scrolling, pane selection, and resizing. -- **Base Index**: Windows and panes start at index `1` instead of `0`. +- **Base Index**: Windows and panes start at index `1` (matching keyboard row `1..9`). +- **Escape Time**: `0ms` (zero delay for responsive escape-key behavior in Vim/Neovim). +- **Clipboard**: OSC 52 integration enabled (`set -s set-clipboard on`), syncing clipboard locally and over SSH. --- ## 2. Keybindings & Controls -### Pane Management -| Shortcut | Action | -| :--- | :--- | -| `Ctrl+A \|` | Split window horizontally. | -| `Ctrl+A -` | Split window vertically. | -| `Ctrl+A h / j / k / l` | Navigate left, down, up, right (Vim style). | -| `Ctrl+A H / J / K / L` | Resize pane left, down, up, right. | -| `Ctrl+A z` | Toggle full-screen zoom on current pane. | -| `Ctrl+A x` | Kill active pane. | +### Smart Neovim / Tmux Navigation (No Prefix Required) +Thanks to `vim-tmux-navigator` integration, you can navigate seamlessly between Vim splits and Tmux panes without pressing the prefix key: -### Window Management | Shortcut | Action | | :--- | :--- | -| `Ctrl+A c` | Create new window. | -| `Ctrl+A n` | Next window. | -| `Ctrl+A p` | Previous window. | -| `Ctrl+A 1..9` | Switch directly to window number. | -| `Ctrl+A ,` | Rename current window. | +| `Ctrl+h` | Move to left pane / Vim split. | +| `Ctrl+j` | Move to down pane / Vim split. | +| `Ctrl+k` | Move to up pane / Vim split. | +| `Ctrl+l` | Move to right pane / Vim split. | + +*(Fallback navigation using prefix: `Ctrl+Space h/j/k/l`)* + +### Pane Management (Prefix: `Ctrl+Space`) +| Shortcut | Action | +| :--- | :--- | +| `Ctrl+Space \|` | Split window horizontally (opens in current working directory). | +| `Ctrl+Space -` | Split window vertically (opens in current working directory). | +| `Ctrl+Space H / J / K / L` | Resize pane left, down, up, right by 5 cells. | +| `Ctrl+Space z` | Toggle full-screen zoom on active pane. | +| `Ctrl+Space x` | Kill active pane. | + +### Window Management (Prefix: `Ctrl+Space`) +| Shortcut | Action | +| :--- | :--- | +| `Ctrl+Space c` | Create new window. | +| `Ctrl+Space n` | Next window. | +| `Ctrl+Space p` | Previous window. | +| `Ctrl+Space 1..9` | Switch directly to window index `1..9`. | +| `Ctrl+Space ,` | Rename current window. | +| `Ctrl+Space r` | Reload `~/.config/tmux/tmux.conf`. | + +### Copy Mode (Vi-Style) +| Shortcut | Action | +| :--- | :--- | +| `Ctrl+Space Escape` | Enter copy mode. | +| `v` | Begin text selection (in copy mode). | +| `Ctrl+v` | Toggle rectangle / block selection. | +| `y` | Copy selection to system clipboard (via OSC 52) and exit copy mode. | --- ## 3. Persistent Sessions + ```bash # Attach or create session named "dev": tmux new-session -A -s dev @@ -44,6 +67,6 @@ tmux new-session -A -s dev # List active sessions: tmux ls -# Detach from session: -Ctrl+A d +# Detach from active session: +Ctrl+Space d ```