2024-07-27 06:49:29 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
python3Packages,
|
|
|
|
fetchFromGitHub,
|
|
|
|
appstream,
|
|
|
|
meson,
|
|
|
|
ninja,
|
|
|
|
pkg-config,
|
|
|
|
gobject-introspection,
|
|
|
|
wrapGAppsHook4,
|
|
|
|
desktop-file-utils,
|
|
|
|
libadwaita,
|
|
|
|
gtksourceview5,
|
|
|
|
xdg-utils,
|
|
|
|
ollama,
|
|
|
|
}:
|
|
|
|
|
|
|
|
python3Packages.buildPythonApplication rec {
|
|
|
|
pname = "alpaca";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "1.1.1";
|
2024-07-27 06:49:29 +00:00
|
|
|
pyproject = false; # Built with meson
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Jeffser";
|
|
|
|
repo = "Alpaca";
|
|
|
|
rev = version;
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-FFMclm+IUEU4cQZ0+uJHDCHytgW8+fygooWw3Nc1jxM=";
|
2024-07-27 06:49:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
appstream
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
gobject-introspection
|
|
|
|
wrapGAppsHook4
|
|
|
|
desktop-file-utils
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libadwaita
|
|
|
|
gtksourceview5
|
|
|
|
];
|
|
|
|
|
|
|
|
dependencies = with python3Packages; [
|
|
|
|
pygobject3
|
|
|
|
requests
|
|
|
|
pillow
|
|
|
|
pypdf
|
|
|
|
pytube
|
|
|
|
html2text
|
|
|
|
];
|
|
|
|
|
|
|
|
dontWrapGApps = true;
|
|
|
|
|
|
|
|
makeWrapperArgs = [
|
|
|
|
"\${gappsWrapperArgs[@]}"
|
|
|
|
"--prefix PATH : ${lib.makeBinPath [ xdg-utils ollama ]}"
|
|
|
|
# Declared but not used in src/window.py, for later reference
|
|
|
|
# https://github.com/flatpak/flatpak/issues/3229
|
|
|
|
"--set FLATPAK_DEST ${placeholder "out"}"
|
|
|
|
];
|
|
|
|
|
|
|
|
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.
|
|
|
|
'';
|
|
|
|
homepage = "https://jeffser.com/alpaca";
|
|
|
|
license = lib.licenses.gpl3Plus;
|
|
|
|
mainProgram = "alpaca";
|
|
|
|
maintainers = with lib.maintainers; [ aleksana ];
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
};
|
|
|
|
}
|