replace update-carnix.sh

Crate2nix hasn't been added to nixpkgs yet so it needs to be pulled in
separately.
This commit is contained in:
Daiderd Jordan 2020-05-24 13:24:00 +02:00
parent c7a5d20f52
commit dcb534e3ae
No known key found for this signature in database
GPG key ID: D02435D05B810C96
4 changed files with 10 additions and 11 deletions

View file

@ -214,8 +214,8 @@ Currently there is no easy way to set up a test instance of ofborg. If `cargo
check` and `cargo test` both succeed, feel free to Pull Request your changes. check` and `cargo test` both succeed, feel free to Pull Request your changes.
Make sure to format your code with `cargo fmt` and check for additional warnings Make sure to format your code with `cargo fmt` and check for additional warnings
with `cargo clippy`. If you added, removed, or updated the dependencies, also be with `cargo clippy`. If you added, removed, or updated the dependencies, also be
sure to update Carnix by running sure to update Cargo.nix by running
[`./nix/update-carnix.sh`](./nix/update-carnix.sh). [`./nix/update-crates.sh`](./nix/update-crates.sh).
To disable warnings as errors, run your command with an empty `RUSTFLAGS`. For To disable warnings as errors, run your command with an empty `RUSTFLAGS`. For
example: example:

View file

@ -57,14 +57,13 @@ in
Build failed because you bumped the Cargo Build failed because you bumped the Cargo
version without regenerating the carnix version without regenerating the Cargo.nix.
file.
Run: Run:
nix-shell --run ./nix/update-carnix.sh nix-shell --run ./nix/update-crates.sh
and commit those changes. and commit those changes.

View file

@ -1,6 +0,0 @@
#!/bin/sh
set -eu
cargo build
carnix generate-nix --src .

6
nix/update-crates.sh Executable file
View file

@ -0,0 +1,6 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -E "with import <nixpkgs> {}; mkShell { nativeBuildInputs = [ (import (builtins.fetchTarball https://github.com/kolloch/crate2nix/archive/0.8.0.tar.gz) {}) ]; }"
set -e
cargo build
crate2nix generate