Skip to content

Commit a4442a3

Browse files
committed
Add nix configs and uv lock file
1 parent 437ffe4 commit a4442a3

File tree

5 files changed

+4123
-0
lines changed

5 files changed

+4123
-0
lines changed

flake.lock

+59
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
inputs.flake-utils.url = "github:numtide/flake-utils";
3+
outputs = { self, nixpkgs, flake-utils }:
4+
flake-utils.lib.eachDefaultSystem (system:
5+
let
6+
pkgs = import nixpkgs {
7+
inherit system;
8+
config.allowUnfree = true;
9+
};
10+
in { devShells.default = import ./shell.nix { inherit pkgs; }; });
11+
}

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ dependencies = [
4242
"torch",
4343
"outlines_core==0.1.26",
4444
"genson",
45+
"pre-commit>=4.0.1",
4546
]
4647
dynamic = ["version"]
4748

shell.nix

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{ pkgs ? import <nixpkgs> { config = { allowUnfree = true; }; } }:
2+
3+
(pkgs.buildFHSEnv {
4+
name = "dottxt-ai";
5+
targetPkgs = pkgs:
6+
with pkgs; [
7+
autoconf
8+
binutils
9+
cmake
10+
cudatoolkit
11+
curl
12+
freeglut
13+
gcc13
14+
git
15+
gitRepo
16+
gnumake
17+
gnupg
18+
gperf
19+
libGL
20+
libGLU
21+
linuxPackages.nvidia_x11
22+
m4
23+
ncurses5
24+
procps
25+
python311
26+
stdenv.cc
27+
unzip
28+
util-linux
29+
uv
30+
xorg.libX11
31+
xorg.libXext
32+
xorg.libXi
33+
xorg.libXmu
34+
xorg.libXrandr
35+
xorg.libXv
36+
zlib
37+
];
38+
39+
multiPkgs = pkgs: with pkgs; [ zlib ];
40+
41+
runScript = "bash";
42+
43+
profile = ''
44+
# CUDA paths
45+
export CUDA_HOME=${pkgs.cudatoolkit}
46+
export CUDA_PATH=${pkgs.cudatoolkit}
47+
48+
# Ensure proper binary paths are included
49+
export PATH=${pkgs.gcc13}/bin:${pkgs.cudatoolkit}/bin:$PATH
50+
51+
# Set library paths, including additional directories for CUPTI
52+
export LD_LIBRARY_PATH=${pkgs.cudatoolkit}/lib64:${pkgs.cudatoolkit}/extras/CUPTI/lib64:${pkgs.linuxPackages.nvidia_x11}/lib:$LD_LIBRARY_PATH
53+
54+
# Add static library paths to EXTRA_LDFLAGS for the linker
55+
export EXTRA_LDFLAGS="-L${pkgs.cudatoolkit}/lib64 -L${pkgs.cudatoolkit}/extras/CUPTI/lib64 -L${pkgs.linuxPackages.nvidia_x11}/lib -L${pkgs.cudatoolkit}/libdevice $EXTRA_LDFLAGS"
56+
export EXTRA_CCFLAGS="-I${pkgs.cudatoolkit}/include $EXTRA_CCFLAGS"
57+
58+
# Set CMake paths
59+
export CMAKE_PREFIX_PATH=${pkgs.cudatoolkit}:${pkgs.linuxPackages.nvidia_x11}:$CMAKE_PREFIX_PATH
60+
61+
# C++ and CC flags
62+
export CXXFLAGS="--std=c++17 $EXTRA_CCFLAGS"
63+
export CC=${pkgs.gcc13}/bin/gcc
64+
export CXX=${pkgs.gcc13}/bin/g++
65+
66+
# NVCC flags to use the right compiler
67+
export NVCC_FLAGS="-ccbin ${pkgs.gcc13}/bin/gcc"
68+
'';
69+
70+
structuredAttrs__ = {
71+
stdenv = pkgs.stdenv.overrideCC pkgs.stdenv.cc pkgs.gcc13;
72+
};
73+
}).env

0 commit comments

Comments
 (0)