Development Guide¶
This guide is for contributors and developers working on the tuinix flake itself -- the "external" environment where the system configuration, installer, and ISO are built and maintained.
Prerequisites¶
You need a working Nix installation with flakes enabled. tuinix is developed on NixOS but the flake can be built from any system with Nix.
Getting started¶
git clone https://github.com/timlinux/tuinix.git
cd tuinix
# Set up pre-commit hooks and dev tools
./scripts/setup-dev.sh
Common tasks¶
Build and test the installer (recommended)¶
Build the ISO¶
Test in a VM¶
./scripts/run-vm.sh iso # Boot the ISO
./scripts/run-vm.sh harddrive # Boot installed system
./scripts/run-vm.sh clean # Remove VM artifacts
Check the flake¶
Build the system configuration¶
Apply changes on an installed system¶
Repository structure¶
tuinix/
├── flake.nix # Main flake -- entry point for everything
├── installer.nix # ISO/installer configuration
├── hosts/ # Per-host configurations
├── modules/ # Custom NixOS modules
│ ├── networking/ # Ethernet, WiFi
│ ├── security/ # Firewall, SSH, sudo
│ └── system/ # ZFS, boot, etc.
├── profiles/ # Shared configuration profiles
├── software/ # Package sets
├── templates/ # Disko templates, hardware templates
├── scripts/ # Build, install, and dev scripts
├── users/ # User account configurations
└── docs/ # MkDocs documentation site
Quality assurance¶
All code goes through pre-commit hooks:
- Nix: nixfmt formatting
- Shell: shellcheck linting
- Markdown: markdownlint
- Python: black, isort, flake8, mypy
- Go: gofmt, golangci-lint, go vet
- Security: detect-secrets
CI runs the same checks on every PR.
Versioning¶
The VERSION file in the repository root is the single point of
truth for the release version (bare semver, e.g. 0.7.1). Never
hardcode a version anywhere else. Everything derives from it:
scripts/build-version.shwritesbuild-info.txt, adding build provenance: a release build (HEAD exactly on thev<VERSION>tag) gets a cleanv0.7.1; anything else becomesv0.7.1-dev-g<commit>[-dirty].installer.nixparsesbuild-info.txtfor the ISO filename, the installer package version, and the version string embedded in the Go TUI (version.txt, shown on the splash and footer).monitor-builds.shand thescripts/build-*/scripts/upload-*helpers readVERSIONdirectly.
To cut a release: update VERSION, add a CHANGELOG.md section, tag
v<VERSION>, and build — the ISO and all displayed strings follow.
Contributing¶
See the Contributing Guidelines for full details on submitting pull requests.