Installation
nix-pins is a Rust CLI. It requires a working Nix installation and the Nixpkgs used by your configuration. The Git Checker also requires git.
Set up Nix
See the official Nix installation guide. The Flake commands below require the nix-command and flakes experimental features.
The default CLI evaluator uses <nixpkgs>. Check that it resolves:
nix eval --impure --raw --expr 'toString <nixpkgs>'
If you have not configured a Nixpkgs path, set one for the current terminal:
export NIX_PATH="nixpkgs=$(nix eval --raw nixpkgs#path)"
If your project needs a fixed Nixpkgs version, point NIX_PATH to the Nixpkgs source already locked by that project. CLI evaluation and the downstream Reader should use compatible Nixpkgs versions, especially when using dependency Builders.
Install with a Flake
The Flake provides packages for x86_64-linux, aarch64-linux, and aarch64-darwin (Apple Silicon Macs). On any of these platforms, run:
nix run github:ercao/nix-pins -- --help
nix profile install github:ercao/nix-pins
nix-pins --version
Nix selects the package for your current system automatically. Each supported system also has app, check, and development shell outputs.
Install from source
Install the Rust toolchain and Nix, then clone the repository and install:
git clone https://github.com/ercao/nix-pins.git
cd nix-pins
cargo install --path crates/cli --locked
nix-pins --help
Add the Cargo installation directory (usually ~/.cargo/bin) to PATH. You can also run cargo run -- status or cargo run -- update inside the repository.
The Reader lives at nix/pins.nix in the source repository. The current Flake package installs the CLI, evaluator, and Reader. This tutorial imports the Reader from the cloned repository. When using it in another project, keep or pin the corresponding tool source version.
Continue with Your first Pin.