Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

braid

braid is a NixOS CLI tool for managing an encrypted btrfs RAID1 NAS. These docs cover end-user workflows, command reference, design decisions, internals, and development practices.

Common tasks

Guides

GuideDescription
Install NixOSInstall NixOS itself before setting up braid
Getting startedFirst-time setup: find disks, create pool, unlock
Day-to-day NAS usageSubvolumes, file permissions, Samba shares
Auto-unlockUSB keyfile setup for unattended reboots
Monitoring and alertsDisk health alerts, beeper, alert commands
Power managementAuto-suspend, Wake-on-LAN, RTC wakeups
Fan controlHDD-driven chassis fan control, SATA hotswap
UPSNUT-backed orderly poweroff, preflight safety, live status
NixOS configurationModule options, scrub scheduling, pinned toolchain
Sharing and permissionsStorage group, mount permissions, Samba
Mounting subvolumesExpose a btrfs subvolume at a custom path
TroubleshootingENOSPC balance, paused balance, missing devices
Recovery scenariosInterrupted operations, lost pool.json, degraded mount

Commands

CommandDescription
addAdd disks to the pool or create a new pool
removeRemove a live disk from the pool
remove-missingForget a dead or missing device entry
replaceReplace a live or dead disk
unlockOpen LUKS devices and mount the pool
lockUnmount the pool and close LUKS devices
seal-mountpointSeal the offline mountpoint immutable (boot-managed)
idleCheck if the pool is idle for auto-suspend
statusPool health, disk status, allocation, scrub info
doctorDiagnostic checks for config and pool health
monitorHealth check for alerting used by systemd timer
ackAcknowledge and silence an active alert
enrollEnroll a USB keyfile for auto-unlock
discoverScan for braid LUKS devices and rebuild pool.json
recoverRecover from an interrupted operation
tuiInteractive dashboard with raw-output Browse tab
ups statusLive UPS state from NUT, with JSON for scripts

Design

DocPurpose
PrinciplesAuthoritative invariants for braid behavior
Decision recordsRationale, history, and rejected alternatives

Internals

DocPurpose
LUKS unlockUnlock, header backup, and recovery-message contract
Device disappearanceExternal-tool output for missing device states
SATA hot-unplugReal hardware observations for hot-unplug behavior
btrfs notesbtrfs RAID profile, balance, ENOSPC, and LUKS notes

Development

DocPurpose
OverviewDevelopment workflow and dependency updates
TestingVM test conventions and framework gotchas
TUI snapshotsRatatui and Insta snapshot review workflow