forked from xjdr-alt/entropix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
66 lines (59 loc) · 1.33 KB
/
shell.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{ pkgs ? import <nixpkgs> { config = { cudaSupport = true; allowUnfree = true; }; } }:
let
python = pkgs.python312;
pythonWithPkgs = python.withPackages (ps:
with ps; [
pip
setuptools
wheel
(catppuccin.overridePythonAttrs (oldAttrs: {
propagatedBuildInputs = (oldAttrs.propagatedBuildInputs or [ ])
++ [ pygments ];
}))
pygments
]);
deps = with pkgs; [
clang
llvmPackages_16.bintools
rustup
linuxPackages.nvidia_x11
freeglut
zlib
gcc
stdenv.cc.cc.lib
stdenv.cc
libGLU
libGL
glib
pango
fontconfig
python312Packages.matplotlib
];
lib-path = with pkgs; lib.makeLibraryPath deps;
extra-ldflags = "-L${pkgs.linuxPackages.nvidia_x11}/lib";
in pkgs.mkShell {
name = "entropix";
buildInputs = deps ++ [
pythonWithPkgs
pkgs.readline
pkgs.libffi
pkgs.openssl
pkgs.git
pkgs.openssh
pkgs.rsync
];
shellHook = ''
SOURCE_DATE_EPOCH=$(date +%s)
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${lib-path}
export CUDA_PATH=${pkgs.cudatoolkit}
export EXTRA_LDFLAGS=${extra-ldflags}
export TZ="America/Toronto"
if [[ ! -f .venv ]] && [[ ! -d .venv ]]; then
setvenv
VENV=$(cat .venv)
source $VIRTUALENV_HOME/$VENV/bin/activate
deactivate
fi
exec zsh
'';
}