Skip to content

Commit 84e4ed2

Browse files
committed
devshells
1 parent d648454 commit 84e4ed2

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/result
2+
/src
3+
# ^-- added in nix fork
24
build/
35
/private*/
46
# A "local" directory for hiding scripts and artifacts from git.

flake.nix

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"${zephyr}?zephyr"
5454
];
5555

56-
preUnpack=''
56+
preUnpack = ''
5757
unpackCmdHooks+=(_unpack_named)
5858
_unpack_named() {
5959
local src="$1"
@@ -95,7 +95,7 @@
9595
dontUseCmakeConfigure = true;
9696

9797
buildPhase = ''
98-
${packages.zmake}/bin/zmake -j8 build ${build} -DCMAKE_MAKE_PROGRAM="${pkgs.ninja}/bin/ninja" -DBUILD_VERSION="${build_version}"
98+
${packages.zmake}/bin/zmake -j8 build ${build}
9999
'';
100100

101101
installPhase = ''
@@ -120,7 +120,7 @@
120120
build-system = [pythonPkgs.setuptools];
121121

122122
postPatch = ''
123-
sed -e 's#"/bin:/usr/bin"#"/bin:/usr/bin:${pkgs.gcc}/bin:${pkgs.dtc}/bin"${
123+
sed -e 's#"/bin:/usr/bin"#"/bin:/usr/bin:${pkgs.gcc}/bin:${pkgs.dtc}/bin:${pkgs.ninja}/bin"${
124124
if pkgs.stdenv.hostPlatform.isDarwin
125125
then '',"DYLD_LIBRARY_PATH":"${pkgs.dtc}/lib"''
126126
else ""
@@ -196,22 +196,30 @@
196196
buildInputs = [pythonPkgs.setuptools];
197197
};
198198

199-
# TODO: local builds in your area
200199
devShells.default = pkgs.mkShell {
201-
buildInputs = with pkgs; [
200+
buildInputs = [
202201
zephyr-sdk
203-
python
202+
pkgs.cmake
203+
pkgs.git
204+
pkgs.ninja
204205
pythonPkgs.pyyaml
205206
pythonPkgs.pykwalify
206207
pythonPkgs.packaging
207208
pythonPkgs.pyelftools
208209
pythonPkgs.colorama
209210
pythonPkgs.setuptools
210-
pythonPkgs.libfdt
211-
dtc
212-
cmake
213-
ninja
211+
packages.zmake
212+
packages.binman
214213
];
214+
215+
shellHook = ''
216+
rm -rf src
217+
mkdir -p src/platform
218+
ln -fs ../.. src/platform/ec
219+
mkdir -p src/third_party/zephyr
220+
ln -fs ${cmsis} src/third_party/zephyr/cmsis
221+
ln -fs ${zephyr} src/third_party/zephyr/main
222+
'';
215223
};
216224
});
217225
}

0 commit comments

Comments
 (0)