Hacksore/dotfiles: Unit Testing the Personal Workspace
How a custom TypeScript CLI and headless Docker containers turned a fragile Neovim configuration into a bulletproof software product.
- Hacksore's repository treats personal dotfiles like enterprise software by enforcing automated CI/CD validation.
- A custom TypeScript CLI orchestrates headless Docker containers to unit-test Neovim configurations.
- The setup programmatically verifies Language Server Protocol (LSP) diagnostics before allowing configuration commits.
- This approach shifts the paradigm from fragile symlink management to a resilient, productized personal workspace.
The Fragility of Personal Configs
Personal configuration files are notoriously fragile. A single plugin update can break an entire workflow. Most developers manage this risk by manually symlinking files and hoping for the best.
If you’ve spent any time customizing your terminal, editor, or shell, you know the pain. You spend hours getting your .zshrc just right, tweaking your Neovim config, perfecting your git aliases. Then you get a new machine and… manually copy everything over. Again.
The Hacksore/dotfiles repository takes a radically different approach. Instead of treating Neovim configurations as a collection of static text files, developer Sean (Hacksore) treats them as source code for a software product. This product requires strict unit testing before deployment.
The TypeScript Orchestrator
The defining feature of this repository is the `packages/hack/` directory. It houses a custom Node.js CLI tool built with TypeScript. This tool abstracts the immense complexity of testing a visual text editor in a continuous integration environment.
When a commit is pushed, the CLI spins up an isolated Docker container. It mounts the local configuration, installs necessary language servers via Mason, and executes Neovim in `--headless` mode. This guarantees a clean room environment for every test run.
Automated LSP Validation
The repository uses the Busted testing framework to verify that the editor is actually intelligent. A custom command named `TestLSPTypescript` waits for the TypeScript language server to attach to a dummy buffer. It then programmatically checks if specific diagnostic errors are present.
If the language server fails to catch a known type mismatch in the dummy file, the CI pipeline fails. This proves the IDE is fully functional before the developer ever opens it.
Lua as the Connective Tissue
Neovim's transition to Lua transformed it from an editor into a programmable platform. The `.config/nvim` architecture leverages this heavily. For example, a sophisticated `on_attach` function for the Rust analyzer dynamically parses the project's `rustfmt.toml` file to automatically sync the editor's tab stops with the project's formatting rules.
The Dotfiles Spectrum
Managing a personal workspace falls on a spectrum. On one end is the raw repository with manual symlinks. In the middle are declarative managers like Chezmoi. On the far end is the Hacksore approach (a productized configuration with zero-regression testing).
| Approach | Primary Tool | Pros | Cons |
|---|---|---|---|
| The Raw Repo | Git + Symlinks | Simple, zero dependencies | Fragile, breaks easily on updates |
| The Manager Tool | Chezmoi / GNU Stow | Cross-platform, handles secrets | Requires learning a new DSL |
| The Productized Config | Custom CLI + Docker | Verifiable, zero-regression | High initial maintenance overhead |
The line between power user and tooling engineer is blurring. Developers are no longer just configuring their tools (they are engineering custom abstractions to guarantee their productivity never breaks).