nixos/tests
Julian Sutter 449510c746 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
2026-02-16 23:08:48 -08:00
..
README.md Reorganize Firefox configuration and repository documentation 2026-02-16 23:08:48 -08:00
test-firefox-config.sh Reorganize Firefox configuration and repository documentation 2026-02-16 23:08:48 -08:00

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:

./test-firefox-config.sh

Requirements:

  • Firefox installed
  • Valid Home Manager configuration
  • JSON parsing tool (jq or Python)

Running Tests

All Tests

tests/test-firefox-config.sh

Specific Test

./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
  • context/ - Configuration documentation
  • agents.md - Agent procedures