nix
This commit is contained in:
parent
8b91ec7c53
commit
d0124c615a
24
default.nix
Normal file
24
default.nix
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
let
|
||||||
|
pkgs = import (fetchTarball { url = "https://github.com/NixOS/nixpkgs/archive/20.03.tar.gz"; sha256 = "0182ys095dfx02vl2a20j1hz92dx3mfgz2a6fhn31bqlp1wa8hlq"; }) {};
|
||||||
|
pyPackages = (python-packages: with python-packages; ([
|
||||||
|
solo-python pytest
|
||||||
|
] ++ (with builtins; map (d: getAttr d python-packages) (filter (d: stringLength d > 0) (pkgs.lib.splitString "\n" (builtins.readFile ./tools/requirements.txt))))));
|
||||||
|
python-with-my-packages = pkgs.python3.withPackages pyPackages;
|
||||||
|
src = ./.;
|
||||||
|
in
|
||||||
|
with pkgs; stdenv.mkDerivation {
|
||||||
|
name = "solo";
|
||||||
|
outputs = [ "out" ];
|
||||||
|
src = with lib; builtins.filterSource (path: type: !(hasSuffix path "hex" || hasSuffix path "sha256")) src;
|
||||||
|
buildInputs = [ gnumake gcc gcc-arm-embedded-8 git python-with-my-packages ];
|
||||||
|
phases = [ "unpackPhase" "configurePhase" "buildPhase" "installPhase" ];
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/firmware $out
|
||||||
|
cd targets/stm32l432
|
||||||
|
make cbor
|
||||||
|
make build-hacker
|
||||||
|
cp *.hex *.sha256 *.elf cubeconfig_stm32l442.ioc $out/firmware/
|
||||||
|
'';
|
||||||
|
keepDebugInfo = true;
|
||||||
|
}
|
||||||
|
|
13
shell.nix
Normal file
13
shell.nix
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
let
|
||||||
|
nixpkgs_tar = fetchTarball { url = "https://github.com/NixOS/nixpkgs/archive/20.03.tar.gz"; sha256 = "0182ys095dfx02vl2a20j1hz92dx3mfgz2a6fhn31bqlp1wa8hlq"; };
|
||||||
|
pkgs = import "${nixpkgs_tar}" {};
|
||||||
|
pyPackages = (python-packages: with python-packages; ([
|
||||||
|
solo-python pytest
|
||||||
|
] ++ (with builtins; map (d: getAttr d python-packages) (filter (d: stringLength d > 0) (pkgs.lib.splitString "\n" (builtins.readFile ./tools/requirements.txt))))));
|
||||||
|
python-with-my-packages = pkgs.python3.withPackages pyPackages;
|
||||||
|
in
|
||||||
|
with pkgs;
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
name = "solo";
|
||||||
|
buildInputs = [ gnumake gcc gcc-arm-embedded-8 python-with-my-packages ];
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user