add devenv and devcontainer to manage environmnet
This commit is contained in:
37
CCPP.nix
Executable file
37
CCPP.nix
Executable 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
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user