- Write NixOS integration tests using `nixosTest` or `pkgs.nixosTest` — define machines with `nodes` and interact via the Python test runner (`machine.wait_for_unit("myservice")`).
- Use `pkgs.runCommand` or `pkgs.testers.runNixOSTest` for lightweight derivation-level tests that validate build outputs without a full VM.
- Test package builds in isolation with `nix-build -A mypackage` before committing — use `nix flake check` to run all checks defined in the flake.
- Use `pkgs.testers.testVersion { package = myPkg; }` to assert the binary version matches `meta.version` — catches version drift between the derivation and the upstream source.