nix flakes support #64
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "mwojcik/thermostat:nixflakes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Support for Nix flakes. Based mostly on mcu/default.nix from nix-scripts.
Tested
nix develop
(allows access to all the programs necessary for building, debugging, flashing) andnix build
. Not tested with Hydra, I'm not sure about that one.@ -0,0 +40,4 @@
};
};
patchPhase = "";
Remove?
@ -0,0 +43,4 @@
patchPhase = "";
nativeBuildInputs = [ pkgs.llvm ];
buildPhase = ''
export CARGO_HOME=$(mktemp -d cargo-home.XXX)
Is CARGO_HOME necessary? NAC3 doesn't use it.
You can use cargoBuildFlags instead.
@ -0,0 +48,4 @@
'';
checkPhase = ''
cargo test --target=${pkgs.rust.toRustTarget pkgs.stdenv.targetPlatform};
cargoTestFlags
@ -0,0 +52,4 @@
'';
# binaryName defaults to the `name` arg (i.e. the Rust package name);
# it is used as the Cargo binary filename
I don't understand this comment?
@ -0,0 +42,4 @@
nativeBuildInputs = [ pkgs.llvm ];
buildPhase = ''
cargo build --release --bin thermostat
cargoBuildFlags?
Is there API of that function described somewhere for quick reference? Besides the little tutorial section...
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
.One usually has to RTFS of nixpkgs for this kind of extended documentation :)
If there's no easy solution then overriding buildPhase is fine.
@ -0,0 +69,4 @@
buildInputs = with pkgs; [
rustPlatform.rust.rustc
rustPlatform.rust.cargo
gcc openocd dfu-util
gcc?
@ -0,0 +71,4 @@
rustPlatform.rust.cargo
gcc openocd dfu-util
] ++ (with python3Packages; [
numpy matplotlib
Did you test this? I think this doesn't work and you need
python3.withPackages
instead.Weirdly enough it seems to work
This is the lab computer and those packages are already included in the system Python. You can use
nix develop --ignore-environment
to isolate the system profile (see https://github.com/NixOS/nix/issues/4359).Still available:
@ -0,0 +56,4 @@
dontFixup = true;
};
in rec {
rec not needed
@ -0,0 +57,4 @@
dontFixup = true;
};
in rec {
packages.x86_64-linux = rec {
also here