This commit introduces a Nix flake (flake.nix and flake.lock) to provide a reproducible development shell for NuttX using Nix and flakes. - Adds a devShell with all required build tools and dependencies for NuttX, including CMake, Ninja, GNU Make, clang-tools, ARM toolchain, and other utilities (automake, bison, flex, genromfs, gettext, gperf, kconfig-frontends, libelf, expat, gmp, isl, libmpc, mpfr, ncurses, zlib, kconfiglib). - Uses flake-utils to support multiple platforms. - Sets up a shell hook to enable CMake compile commands and provide a welcome message. - Based on nixpkgs `nixos-unstable` for up-to-date packages. Purpose: - Simplifies onboarding and ensures a consistent build environment across contributors. - Reduces "works on my machine" issues by pinning dependencies. Tested by running `nix develop` and building NuttX on x86_64-linux. No impact on runtime or target builds; this only affects developer tooling. For more details, see the new flake.nix file. Signed-off-by: Côme VINCENT <44554692+comejv@users.noreply.github.com>
70 lines
1.7 KiB
Nix
70 lines
1.7 KiB
Nix
{
|
|
description = "NuttX : devShell flake";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs =
|
|
{
|
|
self,
|
|
nixpkgs,
|
|
flake-utils,
|
|
...
|
|
}:
|
|
flake-utils.lib.eachDefaultSystem (
|
|
system:
|
|
let
|
|
pkgs = import nixpkgs { inherit system; };
|
|
in
|
|
{
|
|
devShells.default = pkgs.mkShell {
|
|
buildInputs = [
|
|
# Build tools
|
|
pkgs.cmake
|
|
pkgs.ninja
|
|
pkgs.gnumake
|
|
pkgs.clang-tools
|
|
|
|
# ARM toolchain
|
|
pkgs.gcc-arm-embedded
|
|
|
|
# NuttX dependencies
|
|
pkgs.automake
|
|
pkgs.bison
|
|
pkgs.flex
|
|
pkgs.genromfs
|
|
pkgs.gettext
|
|
pkgs.gperf
|
|
pkgs.kconfig-frontends
|
|
pkgs.libelf
|
|
pkgs.expat.dev
|
|
pkgs.gmp.dev
|
|
pkgs.isl
|
|
pkgs.libmpc
|
|
pkgs.mpfr.dev
|
|
pkgs.ncurses.dev
|
|
pkgs.zlib
|
|
pkgs.python313Packages.kconfiglib
|
|
|
|
# NuttX Documentation
|
|
pkgs.sphinx
|
|
pkgs.python313Packages.sphinx_rtd_theme
|
|
pkgs.python313Packages.myst-parser
|
|
pkgs.python313Packages.sphinx-tabs
|
|
pkgs.python313Packages.sphinx-autobuild
|
|
pkgs.python313Packages.sphinx-copybutton
|
|
pkgs.python313Packages.sphinx-togglebutton
|
|
pkgs.python313Packages.pytz
|
|
pkgs.python313Packages.importlib-metadata
|
|
pkgs.python313Packages.sphinx-design
|
|
];
|
|
shellHook = ''
|
|
export CMAKE_EXPORT_COMPILE_COMMANDS=ON
|
|
echo "Welcome to NuttX devShell"
|
|
'';
|
|
};
|
|
}
|
|
);
|
|
}
|