nix flakes support #64
@ -40,19 +40,11 @@
|
||||
};
|
||||
};
|
||||
|
||||
patchPhase = "";
|
||||
nativeBuildInputs = [ pkgs.llvm ];
|
||||
|
||||
buildPhase = ''
|
||||
export CARGO_HOME=$(mktemp -d cargo-home.XXX)
|
||||
cargo build --release --bin thermostat
|
||||
sb10q
commented
cargoBuildFlags? cargoBuildFlags?
mwojcik
commented
Is there API of that function described somewhere for quick reference? Besides the little tutorial section... Is there API of that function described somewhere for quick reference? Besides the little tutorial section...
mwojcik
commented
Actually, using just cargoBuildFlags ( Actually, using just cargoBuildFlags (``--bin thermostat`` as release is already included) causes the build to fail, as the default builder forces ``--target=x86_64-linux``.
sb10q
commented
One usually has to RTFS of nixpkgs for this kind of extended documentation :) One usually has to RTFS of nixpkgs for this kind of extended documentation :)
If there's no easy solution then overriding buildPhase is fine.
|
||||
'';
|
||||
sb10q
commented
Is CARGO_HOME necessary? NAC3 doesn't use it. Is CARGO_HOME necessary? NAC3 doesn't use it.
sb10q
commented
You can use cargoBuildFlags instead. You can use cargoBuildFlags instead.
|
||||
|
||||
checkPhase = ''
|
||||
cargo test --target=${pkgs.rust.toRustTarget pkgs.stdenv.targetPlatform};
|
||||
'';
|
||||
|
||||
# binaryName defaults to the `name` arg (i.e. the Rust package name);
|
||||
# it is used as the Cargo binary filename
|
||||
installPhase = ''
|
||||
mkdir -p $out $out/nix-support
|
||||
cp target/thumbv7em-none-eabihf/release/thermostat $out/thermostat.elf
|
||||
|
Loading…
Reference in New Issue
Block a user
Remove?