testing
Test changes using module-graph and build commands
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Testing
Critical Requirement
After making changes you MUST ALWAYS evaluate and test your changes.
Finding Affected Configurations
Use the module-graph script to determine which hosts and homes are affected by your changes:
./flake/dev/scripts/module-graph.nu
This outputs JSON showing which configurations use each file:
{
"file": "modules/nixos/services/tailscale.nix",
"hosts": ["nixdev", "nixmi", "nixcloud"],
"homes": []
}
Minimum Test Requirements
Based on the module-graph output, you must test at least one of each type affected:
| 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 a host configuration
nix build .#nixosConfigurations.<hostname>.config.system.build.toplevel
Test a 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:
nix build .#nixosConfigurations.nixdev.config.system.build.toplevel -
If the change also affects homes, build one:
nix build .#homeConfigurations."racci@nixmi".activationPackage -
Format your changes:
nix fmt modules/nixos/services/tailscale.nix
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-01-26
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!