nix
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseNix Skill
Nix 技能指南
1. nix build
1. nix build
-
YOU MUST: Always useoption with
--no-linknix buildshnix build .#rumdl --no-link -
IMPORTANT: Without, a
--no-linksymlink is created./result
-
必须:使用时务必添加
nix build选项--no-linkshnix build .#rumdl --no-link -
重要说明:如果不添加,会创建一个
--no-link符号链接./result
2. nix run
2. nix run
-
IMPORTANT: Packages registered in packages can be run with
nix runshnix run .#pike -- scan -d ./terraform
-
重要说明:已在包列表中注册的包可通过运行
nix runshnix run .#pike -- scan -d ./terraform
3. Adding Custom Packages
3. 添加自定义包
- YOU MUST: See CONTRIBUTING.md section 1.4.2 for adding new custom packages
- IMPORTANT: Hash acquisition flow
- Get using nurl:
hashnurl https://github.com/<owner>/<repo> <tag> - Get /
vendorHashvia build error (cargoHashline)got:
- Get
- IMPORTANT: Add if tests fail
doCheck = false;
- 必须:添加新自定义包请查看CONTRIBUTING.md的1.4.2章节
- 重要说明:哈希值获取流程
- 使用nurl获取:
hashnurl https://github.com/<owner>/<repo> <tag> - 通过构建错误信息(行)获取
got:/vendorHashcargoHash
- 使用nurl获取
- 重要说明:如果测试失败,添加
doCheck = false;
4. nurl
4. nurl
-
IMPORTANT: nurl generates Nix fetcher calls from repository URLssh
nurl https://github.com/rvben/rumdl v0.0.206 -
IMPORTANT: Output can be used directly in fetchFromGitHubnix
fetchFromGitHub { owner = "rvben"; repo = "rumdl"; rev = "v0.0.206"; hash = "sha256-XXX..."; } -
IMPORTANT: For cargoHash/vendorHash, use build error method (nurl does not support these)
-
重要说明:nurl可根据仓库URL生成Nix获取器调用代码sh
nurl https://github.com/rvben/rumdl v0.0.206 -
重要说明:输出结果可直接用于fetchFromGitHubnix
fetchFromGitHub { owner = "rvben"; repo = "rumdl"; rev = "v0.0.206"; hash = "sha256-XXX..."; } -
重要说明:对于cargoHash/vendorHash,请使用构建错误信息的方法获取(nurl不支持这些)