-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
48 lines (45 loc) · 1.42 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{
description = "A Nix-flake-based C/C++ development environment";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
inputs.nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
outputs = { self, nixpkgs, nixpkgs-unstable }:
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; };
unstable = import nixpkgs-unstable { inherit system; };
});
in
{
devShells = forEachSupportedSystem ({ pkgs, unstable }:
let
mypkgs = with pkgs; [
stdenv
rdma-core.dev
clang-tools
pkg-config
cmake
ninja
gnumake
gcc11
cudaPackages.cuda_cudart
cudaPackages.cudatoolkit
cudaPackages.libcublas
# Create nvshmem package later on
libunwind
zstd
openmpi
python311
linuxKernel.packages.linux_6_1.nvidia_x11
] ++
(with pkgs.python311Packages; [ pybind11 numpy ]);
in
{
default = pkgs.mkShell {
buildInputs = mypkgs;
nativeBuildInputs = mypkgs;
LD_LIBRARY_PATH = "${pkgs.lib.strings.makeLibraryPath (mypkgs)}";
};
});
};
}