Add setup hook to setup ZEPHYR_SDK_INSTALL_DIR
This commit is contained in:
parent
4a88b31471
commit
066ab5b5e2
10
README.md
10
README.md
|
@ -48,6 +48,11 @@ Develop Zephyr projects using Nix
|
||||||
|
|
||||||
mkShell {
|
mkShell {
|
||||||
packages = [
|
packages = [
|
||||||
|
(zephyr.sdk.override {
|
||||||
|
targets = [
|
||||||
|
"arm-zephyr-eabi"
|
||||||
|
];
|
||||||
|
})
|
||||||
zephyr.pythonEnv
|
zephyr.pythonEnv
|
||||||
# Use zephyr.hosttools-nix to use nixpkgs built tooling instead of official Zephyr binaries
|
# Use zephyr.hosttools-nix to use nixpkgs built tooling instead of official Zephyr binaries
|
||||||
zephyr.hosttools
|
zephyr.hosttools
|
||||||
|
@ -55,11 +60,6 @@ mkShell {
|
||||||
ninja
|
ninja
|
||||||
];
|
];
|
||||||
|
|
||||||
env.ZEPHYR_SDK_INSTALL_DIR = zephyr.sdk.override {
|
|
||||||
targets = [
|
|
||||||
"arm-zephyr-eabi"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
12
default.nix
12
default.nix
|
@ -77,10 +77,18 @@ rec {
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
|
|
||||||
rm zephyr-sdk-$version/zephyr-sdk-${arch}-hosttools-standalone-*.sh
|
rm zephyr-sdk-$version/zephyr-sdk-${arch}-hosttools-standalone-*.sh
|
||||||
rm zephyr-sdk-$version/setup.sh;
|
rm -f env-vars
|
||||||
|
|
||||||
mv zephyr-sdk-$version $out
|
mv zephyr-sdk-$version $out
|
||||||
mv $(ls | grep -v env-vars) $out/
|
|
||||||
|
if [ -n "$(ls -A .)" ]; then
|
||||||
|
mv * $out
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p $out/nix-support
|
||||||
|
cat <<EOF >> $out/nix-support/setup-hook
|
||||||
|
export ZEPHYR_SDK_INSTALL_DIR=$out
|
||||||
|
EOF
|
||||||
|
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in New Issue