This guide covers how to test the NixMox project at different levels, from local builds to full deployment.
- Individual container builds
- Configuration validation
- Syntax checking
- Service configuration validation
- Cross-container dependency checking
- Build artifact generation
- Proxmox LXC container creation
- Service startup and health checks
- End-to-end functionality testing
# Verify Nix is working
nix --version
# Check if you're in the project directory
pwd # Should show /path/to/nixmox# Test all containers build successfully
nix build .#nixosConfigurations.caddy.config.system.build.toplevel
nix build .#nixosConfigurations.authentik.config.system.build.toplevel
nix build .#nixosConfigurations.postgresql.config.system.build.toplevel
nix build .#nixosConfigurations.nextcloud.config.system.build.toplevel
nix build .#nixosConfigurations.media.config.system.build.toplevel
nix build .#nixosConfigurations.monitoring.config.system.build.toplevel
nix build .#nixosConfigurations.guacamole.config.system.build.toplevel
nix build .#nixosConfigurations.vaultwarden.config.system.build.toplevel
nix build .#nixosConfigurations.dns.config.system.build.toplevel
nix build .#nixosConfigurations.mail.config.system.build.toplevel# Validate entire flake
nix flake check
# Check for evaluation errors
nix eval .#nixosConfigurations- Service Configuration: Verify each service has correct options
- Dependency Resolution: Check cross-container dependencies
- Build Artifacts: Generate deployable system images
- Configuration Validation: Ensure no option conflicts
# List available containers
./scripts/deploy-test.sh -l
# Test a specific container
./scripts/deploy-test.sh -t caddy
# Build a container with testing
./scripts/deploy-test.sh -t -o ./builds caddy
# Build all containers for testing
for container in caddy authentik postgresql nextcloud media monitoring guacamole vaultwarden dns mail; do
echo "Building $container..."
./scripts/deploy-test.sh -t -o ./builds $container
done# Test database connections (PostgreSQL first)
./scripts/deploy-test.sh -t postgresql
# Test services that depend on PostgreSQL
./scripts/deploy-test.sh -t nextcloud
./scripts/deploy-test.sh -t authentik
./scripts/deploy-test.sh -t monitoring# Check specific service configurations
nix eval .#nixosConfigurations.caddy.config.services.nixmox.caddy.enable
nix eval .#nixosConfigurations.authentik.config.services.nixmox.authentik.enable
nix eval .#nixosConfigurations.postgresql.config.services.nixmox.postgresql.enable
# Check for configuration conflicts
nix eval .#nixosConfigurations.caddy.config.services.nixmox.caddy.services# Generate container images for Proxmox
./scripts/generate-lxc.sh
# Or use nixos-generators directly
nixos-generators -f proxmox-lxc -c ./flake-modules/containers.nix# If you have LXC/LXD installed locally
sudo lxc launch ubuntu:22.04 test-container
sudo lxc file push ./builds/caddy/activate test-container/root/
sudo lxc exec test-container -- tar -xf /root/activate
sudo lxc exec test-container -- /nix/var/nix/profiles/system/bin/switch-to-configuration test# Use existing deployment scripts
./scripts/deploy-test.sh caddy
./scripts/deploy-test.sh authentik
# For full deployment
./scripts/deploy-remote.sh# Test each service starts correctly
for service in caddy authentik postgresql nextcloud media monitoring; do
echo "Testing $service..."
./scripts/deploy-test.sh -t $service
done# Test database connections
./scripts/deploy-test.sh -t postgresql
./scripts/deploy-test.sh -t nextcloud
# Verify Nextcloud can connect to PostgreSQL
# Check logs for connection success# Test Authentik + Caddy integration
./scripts/deploy-test.sh -t authentik
./scripts/deploy-test.sh -t caddy
# Verify forward auth works
# Test login flow# Test monitoring stack
./scripts/deploy-test.sh -t monitoring
# Verify Prometheus scrapes other services
# Check Grafana dashboards load# Get detailed error information
nix build .#nixosConfigurations.caddy.config.system.build.toplevel --show-trace
# Check specific configuration
nix eval .#nixosConfigurations.caddy.config.services.nixmox.caddy.enable# Validate specific service config
nix eval .#nixosConfigurations.authentik.config.services.nixmox.authentik
# Check for option conflicts
nixos-option services.nixmox.authentik.enable# Run with verbose output
bash -x ./scripts/deploy-test.sh -t caddy
# Check script permissions
ls -la ./scripts/deploy-test.sh
chmod +x ./scripts/deploy-test.sh# Check build logs
nix log /nix/store/...-result
# Check service logs (after deployment)
journalctl -u nixmox-authentik
journalctl -u nixmox-caddy- All containers build successfully
- Flake validation passes
- No evaluation warnings (or acceptable ones)
- Test script runs without errors
- All containers pass configuration tests
- Build artifacts are generated correctly
- Service dependencies are resolved
- Cross-container communication works
- Authentication flow functions
- Monitoring integration works
- Database connections succeed
- LXC images are generated
- Containers start successfully
- Services are accessible
- Health checks pass
- Complete Configuration Testing: Use the test script to validate all containers
- Generate LXC Images: Create deployable container images
- Test Container Startup: Verify containers start and services run
- End-to-End Testing: Test complete authentication and service flows
- Performance Testing: Measure container startup times and resource usage
- Build Issues: Check
nix buildoutput and use--show-trace - Test Script Issues: Use
bash -xfor verbose output - Service Issues: Check logs and verify configuration options
- Configuration Issues: Use
nix evalto debug specific options
- Phase 1: β Complete - All containers build successfully
- Phase 2: π§ In Progress - Configuration testing with deploy-test.sh
- Phase 3: π Planned - Container deployment and end-to-end testing
Happy Testing! π