forked from fooker/mnhttn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
57 lines (45 loc) · 1.01 KB
/
shell.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{ pkgs ? import <nixpkgs> { } }:
let
zephyr-sdk = pkgs.stdenv.mkDerivation rec {
pname = "zephyr-sdk";
version = "0.16.5-1";
src = pkgs.fetchurl {
url = "https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${version}/zephyr-sdk-${version}_linux-${pkgs.stdenv.hostPlatform.linuxArch}.tar.xz";
hash = "sha256-AflCFG0vxtav1a/m9LXDFVJdLJN8fmE9MxKwmSszvGg=";
};
dontStrip = true;
nativeBuildInputs = with pkgs; [
bash
which
cmake
wget
];
patchPhase = ''
patchShebangs setup.sh
'';
dontConfigure = true;
buildPhase = ''
./setup.sh -t arm-zephyr-eabi
'';
installPhase = ''
mv $(pwd) $out
'';
};
in
pkgs.mkShell {
nativeBuildInputs = with pkgs; [
git
kicad
zip
python3Packages.west
python3Packages.pyelftools
cmake
ninja
just
];
ZEPHYR_TOOLCHAIN_VARIANT = "zephyr";
ZEPHYR_SDK_INSTALL_DIR = "${zephyr-sdk}/cmake";
passthru = {
inherit zephyr-sdk;
};
}