blob: 83705d3906379d43444de86221d11c2783309bd5 (
plain) (
blame)
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
67
68
69
70
71
72
73
|
{ lib
, stdenv
, fetchFromGitHub
, cmake
, qt6
, fmt
, shaderc
, vulkan-headers
, wayland
}:
stdenv.mkDerivation (finalAttrs: {
pname = "gpt4all";
version = "2.7.3";
src = fetchFromGitHub {
fetchSubmodules = true;
hash = "sha256-hIfeADP3tiooGZr/OMVFIkOAniMWXj9AsVzMPlVbucE=";
owner = "nomic-ai";
repo = "gpt4all";
rev = "v${finalAttrs.version}";
};
sourceRoot = "${finalAttrs.src.name}/gpt4all-chat";
postPatch = ''
substituteInPlace CMakeLists.txt \
--replace-fail 'set(CMAKE_INSTALL_PREFIX ''${CMAKE_BINARY_DIR}/install)' ""
'';
nativeBuildInputs = [
cmake
qt6.wrapQtAppsHook
];
buildInputs = [
fmt
qt6.qtwayland
qt6.qtquicktimeline
qt6.qtsvg
qt6.qthttpserver
qt6.qtwebengine
qt6.qt5compat
shaderc
vulkan-headers
wayland
];
cmakeFlags = [
"-DKOMPUTE_OPT_USE_BUILT_IN_VULKAN_HEADER=OFF"
"-DKOMPUTE_OPT_DISABLE_VULKAN_VERSION_CHECK=ON"
"-DKOMPUTE_OPT_USE_BUILT_IN_FMT=OFF"
];
postInstall = ''
rm -rf $out/include
rm -rf $out/lib/*.a
mv $out/bin/chat $out/bin/${finalAttrs.meta.mainProgram}
install -m 444 -D $src/gpt4all-chat/flatpak-manifest/io.gpt4all.gpt4all.desktop $out/share/applications/io.gpt4all.gpt4all.desktop
install -m 444 -D $src/gpt4all-chat/icons/logo.svg $out/share/icons/hicolor/scalable/apps/io.gpt4all.gpt4all.svg
substituteInPlace $out/share/applications/io.gpt4all.gpt4all.desktop \
--replace-fail 'Exec=chat' 'Exec=${finalAttrs.meta.mainProgram}'
'';
meta = {
changelog = "https://github.com/nomic-ai/gpt4all/releases/tag/v${finalAttrs.version}";
description = "A free-to-use, locally running, privacy-aware chatbot. No GPU or internet required";
homepage = "https://github.com/nomic-ai/gpt4all";
license = lib.licenses.mit;
mainProgram = "gpt4all";
maintainers = with lib.maintainers; [ drupol polygon ];
};
})
|