Skip to content

Commit

Permalink
feat: add flake.nix for nixOS development
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom94 committed Jan 27, 2025
1 parent afe4057 commit 6a583d5
Show file tree
Hide file tree
Showing 3 changed files with 136 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
strict_env
watch_file ./*.nix
use flake
layout python

61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 70 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
description = "INGP dev env";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
config = {
allowUnfree = true;
cudaSupport = true;
config.cudaVersion = "12";
};
};
in
{
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
gcc
gdb
cmake
pkg-config
binutils
zlib

xorg.libX11.dev
xorg.libXi.dev
xorg.libXrandr.dev
xorg.libXinerama.dev
xorg.libXcursor.dev
xorg.libXext.dev
xorg.libXfixes.dev
xorg.libXrender.dev
libGL
glew

vulkan-loader
vulkan-headers
vulkan-validation-layers
vulkan-extension-layer
vulkan-tools

python3
stdenv.cc.cc.lib

cudatoolkit
cudaPackages.cuda_cudart
cudaPackages.cuda_nvrtc
cudaPackages.cuda_nvtx
];

shellHook = ''
export CUDA_PATH="${pkgs.cudatoolkit}"
export CLANGD_CUDA_INCLUDE="${pkgs.cudatoolkit}"
export LD_LIBRARY_PATH="/run/opengl-driver/lib:${pkgs.zlib}/lib:${pkgs.stdenv.cc.cc.lib}/lib:''${LD_LIBRARY_PATH:-}"
export VULKAN_SDK="${pkgs.vulkan-loader}"
export VK_LAYER_PATH="${pkgs.vulkan-validation-layers}/share/vulkan/explicit_layer.d:${pkgs.vulkan-extension-layer}/share/vulkan/explicit_layer.d"
export VK_ICD_FILENAMES="/run/opengl-driver/share/vulkan/icd.d/nvidia_icd.x86_64.json"
'';
};
}
);
}

0 comments on commit 6a583d5

Please sign in to comment.