-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathimpl.nix
44 lines (41 loc) · 1.18 KB
/
impl.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
{ pkgs, variant, ... }:
let
hardware_deps = with pkgs;
if variant == "CUDA" then [
cudatoolkit
linuxPackages.nvidia_x11
xorg.libXi
xorg.libXmu
freeglut
xorg.libXext
xorg.libX11
xorg.libXv
xorg.libXrandr
zlib
# for xformers
gcc
] else if variant == "ROCM" then [
rocmPackages.rocm-runtime
pciutils
] else if variant == "CPU" then [
] else throw "You need to specify which variant you want: CPU, ROCm, or CUDA.";
in
pkgs.mkShell rec {
name = "stable-diffusion-webui";
buildInputs = with pkgs;
hardware_deps ++ [
git # The program instantly crashes if git is not present, even if everything is already downloaded
python310
stdenv.cc.cc.lib
stdenv.cc
ncurses5
binutils
gitRepo gnupg autoconf curl
procps gnumake util-linux m4 gperf unzip
libGLU libGL
glib
];
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
CUDA_PATH = pkgs.lib.optionalString (variant == "CUDA") pkgs.cudatoolkit;
EXTRA_LDFLAGS = pkgs.lib.optionalString (variant == "CUDA") "-L${pkgs.linuxPackages.nvidia_x11}/lib";
}