59 lines
1.5 KiB
Nix
59 lines
1.5 KiB
Nix
{
|
|
description = "A Nix-flake-based C/C++ development environment";
|
|
|
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
outputs =
|
|
{ self, nixpkgs }:
|
|
let
|
|
supportedSystems = [
|
|
"x86_64-linux"
|
|
"aarch64-linux"
|
|
"x86_64-darwin"
|
|
"aarch64-darwin"
|
|
];
|
|
forEachSupportedSystem =
|
|
f:
|
|
nixpkgs.lib.genAttrs supportedSystems (
|
|
system:
|
|
f {
|
|
pkgs = import nixpkgs { inherit system; };
|
|
}
|
|
);
|
|
in
|
|
{
|
|
devShells = forEachSupportedSystem (
|
|
{ pkgs }:
|
|
{
|
|
default =
|
|
pkgs.mkShell.override
|
|
{
|
|
# Override stdenv in order to change compiler:
|
|
# stdenv = pkgs.clangStdenv;
|
|
}
|
|
|
|
{
|
|
nativeBuildInputs = with pkgs; [
|
|
pkg-config
|
|
];
|
|
packages =
|
|
with pkgs;
|
|
[
|
|
clang-tools
|
|
cmake
|
|
codespell
|
|
cppcheck
|
|
doxygen
|
|
gtest
|
|
lcov
|
|
nodejs
|
|
vscode-extensions.vadimcn.vscode-lldb
|
|
]
|
|
++ (if system == "aarch64-darwin" then [ ] else [ gdb ]);
|
|
CODELLDB_PATH = "${pkgs.vscode-extensions.vadimcn.vscode-lldb}/share/vscode/extensions/vadimcn.vscode-lldb/adapter/codelldb";
|
|
};
|
|
}
|
|
);
|
|
};
|
|
}
|