automatic1111-webui-nix/impl.nix

41 lines
985 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
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;
2023-04-04 13:00:18 +03:00
CUDA_PATH = pkgs.lib.optionalString isCUDA pkgs.cudatoolkit;
EXTRA_LDFLAGS = pkgs.lib.optionalString isCUDA "-L${pkgs.linuxPackages.nvidia_x11}/lib";
2022-12-31 13:02:46 +03:00
}