Merge pull request #430 from nix-community/feat/make-crane-default

This commit is contained in:
Yusuf Bera Ertan 2022-12-18 03:33:49 +03:00 committed by GitHub
commit 2d7d68505c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 3 deletions

View File

@ -14,11 +14,11 @@ Translates a `Cargo.toml` file to a dream2nix lockfile by generating a `Cargo.lo
## Builders
### build-rust-package (pure) (default)
### build-rust-package (pure)
Builds a package using `buildRustPackage` from `nixpkgs`.
### crane (ifd)
### crane (ifd) (default)
Builds a package using [`crane`](https://github.com/ipetkov/crane).
This builder builds two separate derivations, one for dependencies and the other for your crate.
@ -173,3 +173,19 @@ in
# ...
}
```
### Specifying the `stdenv`
`crane` supports specifying the `stdenv` like so:
```nix
{
# ...
packageOverrides = {
# change all derivations' stdenv to clangStdenv
"^.*".set-stdenv.override = old: {stdenv = pkgs.clangStdenv;};
};
# ...
}
```
`build-rust-package` builder does not support specifying the `stdenv`.

View File

@ -2,7 +2,7 @@
l = config.lib;
defaults = {
# TODO: define a priority in each builder and remove the defaults here.
rust = "build-rust-package";
rust = "crane";
nodejs = "granular-nodejs";
python = "simple-python";
php = "granular-php";