nix flakes support #64
@ -41,6 +41,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgs.llvm ];
|
nativeBuildInputs = [ pkgs.llvm ];
|
||||||
|
|||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
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.
|
|||||||
cargo build --release --bin thermostat
|
cargo build --release --bin thermostat
|
||||||
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.
|
|||||||
'';
|
'';
|
||||||
@ -69,7 +70,7 @@
|
|||||||
buildInputs = with pkgs; [
|
buildInputs = with pkgs; [
|
||||||
rustPlatform.rust.rustc
|
rustPlatform.rust.rustc
|
||||||
rustPlatform.rust.cargo
|
rustPlatform.rust.cargo
|
||||||
sb10q
commented
gcc? gcc?
|
|||||||
gcc openocd dfu-util
|
openocd dfu-util
|
||||||
] ++ (with python3Packages; [
|
] ++ (with python3Packages; [
|
||||||
sb10q
commented
Did you test this? I think this doesn't work and you need Did you test this? I think this doesn't work and you need ``python3.withPackages`` instead.
mwojcik
commented
Weirdly enough it seems to work
Weirdly enough it seems to work
```shell
❯ nix develop
[spaqin@hera:~/m-labs/thermostat]$ python
Python 3.9.6 (default, Jun 28 2021, 08:57:49)
[GCC 10.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> import matplotlib
>>>
```
sb10q
commented
This is the lab computer and those packages are already included in the system Python. You can use 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).
mwojcik
commented
Still available:
Still available:
```shell
❯ nix develop --ignore-environment
bash-5.1$ python
Python 3.9.6 (default, Jun 28 2021, 08:57:49)
[GCC 10.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
>>> import numpy
>>>
```
|
|||||||
numpy matplotlib
|
numpy matplotlib
|
||||||
]);
|
]);
|
||||||
|
Remove?