automatic1111-webui-nix/impl.nix

42 lines
974 B
Nix
Raw Normal View History

2023-04-03 16:07:27 +03:00
{ pkgs, isCUDA ? true, ... }:
2022-12-31 13:02:46 +03:00
2023-04-03 16:07:27 +03:00
let
cuda_path = if isCUDA then pkgs.cudatoolkit else "";
hardware_deps = with pkgs;
if isCUDA then [
cudatoolkit
linuxPackages.nvidia_x11
xorg.libXi
xorg.libXmu
freeglut
xorg.libXext
xorg.libX11
xorg.libXv
xorg.libXrandr
zlib
] else [
rocm-runtime
pciutils
];
in
2022-12-31 13:02:46 +03:00
pkgs.mkShell rec {
name = "stable-diffusion-webui";
2023-04-03 16:07:27 +03:00
buildInputs = with pkgs;
hardware_deps ++ [
2022-12-31 13:02:46 +03:00
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
];
2023-04-03 16:07:27 +03:00
LD_LIBRARY_PATH=pkgs.lib.makeLibraryPath buildInputs;
CUDA_PATH=pkgs.cudatoolkit;
EXTRA_LDFLAGS="-L${pkgs.linuxPackages.nvidia_x11}/lib";
2022-12-31 13:02:46 +03:00
}