| name | nix |
| description | Nix commands and package management guide.
Use when:
- Running nix build, nix run
- Adding custom packages
- Using nurl for hash acquisition
|
Guide Nix commands, package management, and hash acquisition workflows.
Always use `--no-link` option with `nix build` to prevent `./result` symlink creation
See CONTRIBUTING.md section 1.4.2 for adding new custom packages
Add `doCheck = false;` if tests fail during package build
Building Nix packages
nix build .#rumdl --no-link
Running packages registered in packages
nix run .#pike -- scan -d ./terraform
Hash acquisition flow for new custom packages
1. Get `hash` using nurl: `nurl https://github.com/<owner>/<repo> <tag>`
2. Get `vendorHash`/`cargoHash` via build error (`got:` line)
Generate Nix fetcher calls from repository URLs
nurl https://github.com/rvben/rumdl v0.0.206
Output can be used directly in fetchFromGitHub:
fetchFromGitHub {
owner = "rvben";
repo = "rumdl";
rev = "v0.0.206";
hash = "sha256-XXX...";
}
</output_usage>
<note>For cargoHash/vendorHash, use build error method (nurl does not support these)</note>
Use `--no-link` with all `nix build` commands
Running `nix build` without `--no-link` (creates unwanted `./result` symlink)