A Nix library for building cargo projects. Never build twice thanks to incremental artifact caching.
Go to file
Ivan Petkov cfb6efcfc7
Update flake.lock (#238)
flake.lock: Update

Flake lock file updates:

• Updated input 'flake-utils':
    'github:numtide/flake-utils/5aed5285a952e0b949eb3ba02c12fa4fcfef535f' (2022-11-02)
  → 'github:numtide/flake-utils/3db36a8b464d0c4532ba1c7dda728f4576d6d073' (2023-02-13)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/006c3bd4dd2f5d1d2094047f307cbf9e2b73d9c5' (2023-02-02)
  → 'github:NixOS/nixpkgs/6d33e5e14fd12f99ba621683ae90cebadda753ca' (2023-02-15)
• Updated input 'rust-overlay':
    'github:oxalica/rust-overlay/383a4acfd11d778d5c2efcf28376cbd845eeaedf' (2023-02-03)
  → 'github:oxalica/rust-overlay/a619538647bd03e3ee1d7b947f7c11ff289b376e' (2023-02-15)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-02-16 02:44:59 +00:00
.github ci: bump to cachix/install-nix-action@19 (#231) 2023-02-08 00:03:11 +00:00
checks crateNameFromCargoToml: warn when values can't be found (#237) 2023-02-12 00:39:43 +00:00
docs crateNameFromCargoToml: warn when values can't be found (#237) 2023-02-12 00:39:43 +00:00
examples docs: Clarify docs and add example of setting custom environment variable (#233) 2023-02-09 00:27:05 +00:00
extra-tests chore: bump all Cargo.lock files (#230) 2023-02-07 23:47:42 +00:00
lib crateNameFromCargoToml: warn when values can't be found (#237) 2023-02-12 00:39:43 +00:00
pkgs Update flake.lock (#238) 2023-02-16 02:44:59 +00:00
.envrc Move all tests (except for formatting) out of flake checks 2021-12-30 17:18:17 -08:00
.git-blame-ignore-revs Ignore blame from fmt revision 2022-11-20 16:31:44 -08:00
.gitignore Properly handle workspace inheritance in git dependencies (#224) 2023-01-21 16:46:32 -08:00
CHANGELOG.md crateNameFromCargoToml: warn when values can't be found (#237) 2023-02-12 00:39:43 +00:00
default.nix flake: deprecate the packages flake output (#130) 2022-10-09 10:28:48 -07:00
flake.lock Update flake.lock (#238) 2023-02-16 02:44:59 +00:00
flake.nix Properly handle workspace inheritance in git dependencies (#224) 2023-01-21 16:46:32 -08:00
LICENSE Add LICENSE 2022-01-17 15:05:45 -08:00
README.md book: fix references 2022-12-26 14:55:25 -08:00
shell.nix default.nix: Move to shell.nix 2022-06-02 14:23:13 +08:00

Crane

A Nix library for building cargo projects.

  • Source fetching: automatically done using a Cargo.lock file
  • Incremental: build your workspace dependencies just once, then quickly lint, build, and test changes to your project without slowing down
  • Composable: split builds and tests into granular steps. Gate CI without burdening downstream consumers building from source.

Features

  • Automatic vendoring of dependencies in a way that works with Nix
    • Alternative cargo registries are supported (with a minor configuration change)
    • Git dependencies are automatically supported without additional configuration.
      • Cargo retains the flexibility to only use these dependencies when they are actually needed, without forcing an override for the entire workspace.
  • Reusing dependency artifacts after only building them once
  • clippy checks
  • rustfmt checks
  • cargo-audit for vulnerability scanning
  • cargo-nextest a next-generation test runner
  • cargo-tarpaulin for code coverage

Getting Started

The easiest way to get started is to initialize a flake from a template:

# Start with a comprehensive suite of tests
nix flake init -t github:ipetkov/crane#quick-start

Otherwise check out the examples and templates for more detailed examples. An API Reference is also available.

Compatibility Policy

Breaking changes can land on the master branch at any time, so it is recommended you use a versioning strategy when consuming this library (for example, using something like flakes or niv).

Tagged releases will be cut periodically and changes will be documented in the CHANGELOG. Release versions will follow Semantic Versioning.

The test suite is run against the latest stable nixpkgs release, as well as nixpkgs-unstable. Any breakage on those channels is considered a bug and should be reported as such.

License

This project is licensed under the MIT license.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion by you, shall be licensed as MIT, without any additional terms or conditions.