-
-
Notifications
You must be signed in to change notification settings - Fork 19.7k
Expand file tree
/
Copy pathpackage.nix
More file actions
142 lines (131 loc) · 2.71 KB
/
Copy pathpackage.nix
File metadata and controls
142 lines (131 loc) · 2.71 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
{
lib,
python3Packages,
fetchFromGitHub,
appstream,
meson,
ninja,
pkg-config,
gobject-introspection,
wrapGAppsHook4,
desktop-file-utils,
libadwaita,
gtksourceview5,
xdg-utils,
ollama,
vte-gtk4,
libspelling,
nix-update-script,
blueprint-compiler,
libportal,
webkitgtk_6_0,
pipewire,
glib-networking,
bash,
}:
let
pythonPackages = python3Packages.overrideScope (
self: super: {
bibtexparser = self.bibtexparser_2;
}
);
in
pythonPackages.buildPythonApplication rec {
pname = "alpaca";
version = "9.2.4";
pyproject = false; # Built with meson
src = fetchFromGitHub {
owner = "Jeffser";
repo = "Alpaca";
tag = version;
hash = "sha256-rZ1H4QfxkBo+fVFCDODaio+1NEwRVjIY388Q9sR8qO4=";
};
postPatch = ''
substituteInPlace src/widgets/activities/terminal.py \
--replace-fail "['bash', '-c', ';\n'.join(self.prepare_script())]," "['${bash}/bin/bash', '-c', ';\n'.join(self.prepare_script())],"
'';
nativeBuildInputs = [
appstream
meson
ninja
pkg-config
gobject-introspection
wrapGAppsHook4
desktop-file-utils
blueprint-compiler
];
buildInputs = [
libadwaita
gtksourceview5
vte-gtk4
libspelling
libportal
webkitgtk_6_0
pipewire # pipewiresrc
glib-networking
];
dependencies =
with pythonPackages;
[
pygobject3
requests
pillow
html2text
youtube-transcript-api
pydbus
odfpy
pyicu
matplotlib
openai
markitdown
gst-python
opencv4
zstandard
pythonPackages.ollama
]
++ lib.concatAttrValues optional-dependencies;
optional-dependencies = with pythonPackages; {
speech-to-text = [
openai-whisper
pyaudio
];
text-to-speech = [
kokoro
sounddevice
spacy-models.en_core_web_sm
];
image-tools = [ rembg ];
};
dontWrapGApps = true;
makeWrapperArgs = [
"\${gappsWrapperArgs[@]}"
"--prefix PATH : ${
lib.makeBinPath [
xdg-utils
ollama
]
}"
];
passthru.updateScript = nix-update-script { };
meta = {
description = "Ollama client made with GTK4 and Adwaita";
longDescription = ''
To run Alpaca with GPU acceleration enabled, simply override it:
```nix
pkgs.alpaca.override {
ollama = pkgs.ollama-cuda;
}
```
Or using `pkgs.ollama-rocm` for AMD GPUs.
For a vendor agnostic solution, use: `pkgs.ollama-vulkan`.
'';
homepage = "https://jeffser.com/alpaca";
license = lib.licenses.gpl3Plus;
mainProgram = "alpaca";
maintainers = with lib.maintainers; [
aleksana
Gliczy
];
platforms = lib.platforms.unix;
};
}