Nix commands and package management guide. Use when: - Running nix build, nix run - Adding custom packages - Using nurl for hash acquisition
YOU MUST: Always use --no-link option with nix build
nix build .#rumdl --no-link
IMPORTANT: Without --no-link, a ./result symlink is created
IMPORTANT: Packages registered in packages can be run with nix run
nix run .#pike -- scan -d ./terraform
hash using nurl: nurl https://github.com/<owner>/<repo> <tag>vendorHash/cargoHash via build error (got: line)doCheck = false; if tests failIMPORTANT: nurl generates Nix fetcher calls from repository URLs
nurl https://github.com/rvben/rumdl v0.0.206
IMPORTANT: Output can be used directly in fetchFromGitHub
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)