# ipetkov/crane

A Nix library for building cargo projects. Never build twice thanks to incremental artifact caching.

Repository: https://github.com/ipetkov/crane
Canonical: https://ross.abutalabs.com/products/ipetkov-crane
Homepage: https://crane.dev
Language: Nix
License: MIT
License Family: permissive
Topics: nixos, nixpkgs, nix, rust, cargo, crate
Last push: 2026-08-21T15:39:08+00:00

## Health v2 (maintenance only)
Score: 98/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 98, release rhythm 98, longevity 100
- inputs: {"age_days": 1690, "days_push": 12, "days_rel": 12, "gap_med": 30, "n_releases_24m": 20}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1450, forks 139 (observed 2026-08-28T04:04:45.830756+00:00)

## What it is
Crane is a Nix library for building Cargo (Rust) projects with incremental artifact caching so dependencies are built only once. It provides composable, granular build, lint, test, and documentation steps plus automatic dependency vendoring from Cargo.lock.

## Use cases
- build rust projects with nix flakes
- cache cargo dependencies so I never rebuild them
- run clippy and rustfmt checks in nix
- set up reproducible CI for a cargo workspace
- cross-compile rust to musl or wasm targets
- vendor cargo dependencies including git dependencies
- build a rust webapp with trunk using nix

## When to choose
- you use Nix and want fast, incremental, reproducible Rust builds
- you want granular CI steps (lint, test, doc) without rebuilding dependencies
- you need cross-compilation or alternative crate registries in Nix

## When to avoid
- you don't use Nix and just want a plain cargo build
- you need a simple one-command Rust build tool without a Nix dependency
- you require Nix versions below 2.31.2 or older nixpkgs channels

## Facets
- artifact type: library
- maturity: active
- function: build-tool, developer-tools, testing, ci-cd
- domain: developer-tools, programming-languages
- platform: cross-platform, cli
- tags: nix, nix-flakes, rust, cargo, reproducible-builds, caching, cross-compilation, devops, linux, macos

## Member repositories
- ipetkov/crane (main) score 98

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:45.830756+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:35:56.587914+00:00, confidence not recorded.
  - readme: https://github.com/ipetkov/crane (fetched 2026-08-28T04:04:45.830756+00:00, sha 91dc9eaab65a)
  - homepage: https://crane.dev (fetched 2026-08-29T11:45:28.622066+00:00, sha 899fdba83954)
  - site_page: https://crane.dev/getting-started.html (fetched 2026-08-29T11:45:28.639629+00:00, sha a3a604ba7f1f)
  - site_page: https://crane.dev/CHANGELOG.html (fetched 2026-08-29T11:45:28.642468+00:00, sha b101df0b1106)
- Data as of 2026-08-30T08:39:29.467469+00:00.
