| name | testing |
| description | Test changes using module-graph and build commands |
Testing
Critical Requirement
After making changes you must always evaluate and test them.
Finding Affected Configurations
Use module-graph script to find which hosts and homes are affected by changed files:
./flake/dev/scripts/module-graph.nu
This outputs JSON showing which configs use each file:
{
"file": "modules/nixos/services/tailscale.nix",
"hosts": ["nixdev", "nixmi", "nixcloud"],
"homes": []
}
Minimum Test Requirements
Based on module-graph output, test at least one of each affected type:
| Changed File Affects | Minimum Test |
|---|
| Hosts only | Build one affected host |
| Homes only | Build one affected home |
| Both hosts and homes | Build one host and one home |
Test Commands
Test host configuration
nix build .#nixosConfigurations.<hostname>.config.system.build.toplevel
Test home configuration
nix build .#homeConfigurations."<user>@<host>".activationPackage
Run full flake check
nix flake check --override-input devenv-root "file+file://$PWD/.devenv/root"
Testing Workflow Example
-
Make changes to modules/nixos/services/tailscale.nix
-
Run module-graph to find affected configs:
./flake/dev/scripts/module-graph.nu | jq '.[] | select(.file | contains("tailscale"))'
-
Pick one affected host and build it:
nix build .#nixosConfigurations.nixdev.config.system.build.toplevel
-
If change also affects homes, build one:
nix build .#homeConfigurations."racci@nixmi".activationPackage