tools/nix: Add Nix flake for reproducible dev environment
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>
2025-07-25 13:43:35 -04:00
|
|
|
{
|
|
|
|
|
description = "NuttX : devShell flake";
|
|
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
2025-08-11 16:26:46 -04:00
|
|
|
documentation.url = "path:./Documentation";
|
tools/nix: Add Nix flake for reproducible dev environment
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>
2025-07-25 13:43:35 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
outputs =
|
|
|
|
|
{
|
|
|
|
|
self,
|
|
|
|
|
nixpkgs,
|
|
|
|
|
flake-utils,
|
2025-08-11 16:26:46 -04:00
|
|
|
documentation,
|
tools/nix: Add Nix flake for reproducible dev environment
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>
2025-07-25 13:43:35 -04:00
|
|
|
...
|
|
|
|
|
}:
|
|
|
|
|
flake-utils.lib.eachDefaultSystem (
|
|
|
|
|
system:
|
|
|
|
|
let
|
|
|
|
|
pkgs = import nixpkgs { inherit system; };
|
|
|
|
|
in
|
|
|
|
|
{
|
2025-08-11 16:26:46 -04:00
|
|
|
# Default devShell
|
tools/nix: Add Nix flake for reproducible dev environment
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>
2025-07-25 13:43:35 -04:00
|
|
|
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
|
|
|
|
|
];
|
|
|
|
|
shellHook = ''
|
|
|
|
|
export CMAKE_EXPORT_COMPILE_COMMANDS=ON
|
|
|
|
|
echo "Welcome to NuttX devShell"
|
|
|
|
|
'';
|
|
|
|
|
};
|
2025-08-11 16:26:46 -04:00
|
|
|
|
|
|
|
|
# Documentation devShell
|
|
|
|
|
devShells.docs = documentation.devShells.${system}.default;
|
tools/nix: Add Nix flake for reproducible dev environment
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>
2025-07-25 13:43:35 -04:00
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|