add devenv and devcontainer to manage environmnet

This commit is contained in:
2024-10-15 13:15:37 +00:00
parent 92b2097a97
commit 09e44a6ba8
18 changed files with 793 additions and 15 deletions

37
CCPP.nix Executable file
View File

@@ -0,0 +1,37 @@
{
config,
pkgs,
lib,
...
}: {
# Add packages to the dev environment
packages = with pkgs; [
# C/C++
xmake
gnumake
cmake
ninja
# gcc
gcc_multi
neocmakelsp
clang-tools
];
# Enable languages support
# languages.cplusplus.enable = true;
env = {
NIX_LD_LIBRARY_PATH = with pkgs;
lib.makeLibraryPath [
# stdenv_32bit.cc.cc
glibc_multi
];
NIX_LD = with pkgs; lib.fileContents "${stdenv_32bit.cc}/nix-support/dynamic-linker";
};
# When enter shell, exec ...
enterShell = ''
export LD_LIBRARY_PATH=$NIX_LD_LIBRARY_PATH
export LD=$NIX_LD
gcc --version
'';
}