Add zephyr dev shell
This commit is contained in:
parent
f728872208
commit
adfa8f8a6e
|
@ -8,10 +8,16 @@
|
||||||
|
|
||||||
outputs = { self, nixpkgs, utils }:
|
outputs = { self, nixpkgs, utils }:
|
||||||
utils.lib.eachDefaultSystem (system:
|
utils.lib.eachDefaultSystem (system:
|
||||||
let pkgs = import nixpkgs { inherit system; };
|
let
|
||||||
|
pkgs = import nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
overlays = [ (final: prev: self.packages."${system}") ];
|
||||||
|
};
|
||||||
in {
|
in {
|
||||||
packages = { zephyr = pkgs.callPackage ./packages/zephyr { }; };
|
packages = { zephyr = pkgs.callPackage ./packages/zephyr { }; };
|
||||||
|
|
||||||
|
devShells = { zephyr = pkgs.callPackage ./shells/zephyr { }; };
|
||||||
|
|
||||||
formatter = pkgs.nixfmt;
|
formatter = pkgs.nixfmt;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{ callPackage, stdenv, lib }:
|
{ callPackage, stdenv, lib }:
|
||||||
let assets = lib.importJSON ./assets.json;
|
let assets = lib.importJSON ./assets.json;
|
||||||
in rec {
|
in {
|
||||||
host-tools = callPackage ./host-tools.nix {
|
host-tools = callPackage ./host-tools.nix {
|
||||||
inherit (assets) version hosts;
|
inherit (assets) version hosts;
|
||||||
sources = assets.host_tools;
|
sources = assets.host_tools;
|
||||||
|
@ -13,7 +13,6 @@ in rec {
|
||||||
}) assets.toolchains;
|
}) assets.toolchains;
|
||||||
|
|
||||||
sdk = callPackage ./sdk.nix {
|
sdk = callPackage ./sdk.nix {
|
||||||
inherit host-tools;
|
|
||||||
inherit (assets) version hosts;
|
inherit (assets) version hosts;
|
||||||
source = assets.sdk;
|
source = assets.sdk;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{ lib, symlinkJoin, fetchurl, host-tools, source, version, hosts
|
{ lib, symlinkJoin, fetchurl, zephyr, source, version, hosts, toolchains ? [ ]
|
||||||
, toolchains ? [ ] }:
|
}:
|
||||||
let src = fetchurl source;
|
let src = fetchurl source;
|
||||||
in symlinkJoin rec {
|
in symlinkJoin rec {
|
||||||
pname = "zephyr-sdk";
|
pname = "zephyr-sdk";
|
||||||
inherit version;
|
inherit version;
|
||||||
name = "${pname}-${version}";
|
name = "${pname}-${version}";
|
||||||
|
|
||||||
paths = [ host-tools ] ++ toolchains;
|
paths = [ zephyr.host-tools ] ++ toolchains;
|
||||||
postBuild = ''
|
postBuild = ''
|
||||||
tar -C "$out" -xf "${src}" --exclude setup.sh --exclude sdk_toolchains --strip-components=1
|
tar -C "$out" -xf "${src}" --exclude setup.sh --exclude sdk_toolchains --strip-components=1
|
||||||
'';
|
'';
|
||||||
|
|
24
shells/zephyr/default.nix
Normal file
24
shells/zephyr/default.nix
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{ mkShell, zephyr, cmake, ninja, gnumake, python3
|
||||||
|
, toolchains ? with zephyr.toolchains; [ arm-zephyr-eabi ] }:
|
||||||
|
let zephyr-sdk = zephyr.sdk.override { inherit toolchains; };
|
||||||
|
in mkShell {
|
||||||
|
packages = [ cmake ninja gnumake python3 ] ++ (with python3.pkgs; [
|
||||||
|
# requirements-base.txt
|
||||||
|
pyelftools
|
||||||
|
pyyaml
|
||||||
|
pykwalify
|
||||||
|
canopen
|
||||||
|
packaging
|
||||||
|
progress
|
||||||
|
psutil
|
||||||
|
pylink-square
|
||||||
|
pyserial
|
||||||
|
requests
|
||||||
|
anytree
|
||||||
|
intelhex
|
||||||
|
west
|
||||||
|
]);
|
||||||
|
|
||||||
|
ZEPHYR_TOOLCHAIN_VARIANT = "zephyr";
|
||||||
|
ZEPHYR_SDK_INSTALL_DIR = "${zephyr-sdk}";
|
||||||
|
}
|
Loading…
Reference in a new issue