Reorganize Firefox configuration and repository documentation

- Configure Firefox with privacy settings and extensions (Bitwarden, Plasma Integration, MetaMask, Kagi Search, uBlock Origin)
- Set Kagi as default/only search engine
- Add MOZ_USE_XINPUT2=1 for smooth scrolling
- Create context/ directory for concise unit documentation
- Create tests/ directory for test scripts
- Move test-firefox-config.sh to tests/
- Update agents.md with documentation workflow guidelines
- Fix syntax errors in desktop.nix and dev.nix
This commit is contained in:
Julian Sutter 2026-02-16 23:08:48 -08:00
parent 67581adde6
commit 449510c746
10 changed files with 994 additions and 111 deletions

76
tests/README.md Normal file
View file

@ -0,0 +1,76 @@
# Tests Directory
This directory contains test scripts for verifying NixOS configurations.
## Purpose
Automated verification of system configurations to catch issues before deployment.
## Available Tests
### Firefox Configuration Test
**Script:** `test-firefox-config.sh`
Verifies Firefox Home Manager configuration for user `jsutter`:
- Environment variables (`MOZ_USE_XINPUT2`)
- Policy file existence and validity
- Extension policies
- Profile preferences
- Privacy settings
**Usage:**
```bash
./test-firefox-config.sh
```
**Requirements:**
- Firefox installed
- Valid Home Manager configuration
- JSON parsing tool (`jq` or Python)
## Running Tests
### All Tests
```bash
tests/test-firefox-config.sh
```
### Specific Test
```bash
./tests/test-firefox-config.sh
```
## Test Conventions
### Shell Scripts
- Use `set -e` for error handling
- Define colored output for readability
- Track pass/fail/skip counts
- Return non-zero on failure
- Use helper functions (`print_pass`, `print_fail`, etc.)
### Test Coverage
Tests should verify:
- Configuration builds successfully
- Policies are active (`about:policies`)
- Settings are enforced
- Extensions are force-installed
- User preferences are applied
## Adding New Tests
1. Create test script in `tests/`
2. Make executable: `chmod +x tests/new-test.sh`
3. Document in this README
4. Follow naming convention: `test-<service>.sh`
## Notes
- Many tests require services to be deployed first
- Some Firefox tests require Firefox to have been run once
- Automated tests complement manual verification
- Update test scripts when configurations change
## Related Documentation
- `context/` - Configuration documentation
- `agents.md` - Agent procedures