2023-04-12 12:48:02 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, darwin
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pkg-config
|
2024-07-27 06:49:29 +00:00
|
|
|
, installShellFiles
|
2023-04-12 12:48:02 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "aichat";
|
2024-10-04 16:56:33 +00:00
|
|
|
version = "0.22.0";
|
2023-04-12 12:48:02 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sigoden";
|
|
|
|
repo = "aichat";
|
|
|
|
rev = "v${version}";
|
2024-10-04 16:56:33 +00:00
|
|
|
hash = "sha256-gUn1NnEbiZbg7zBer1KX8smBCpcL0fQ+TkEoH8kdPws=";
|
2023-04-12 12:48:02 +00:00
|
|
|
};
|
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
cargoHash = "sha256-xbWcH8kkDe3+IEeHqxd8QW1h5oPDJfAkfNzJp8MWLR8=";
|
2023-04-12 12:48:02 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
2024-07-27 06:49:29 +00:00
|
|
|
installShellFiles
|
2023-04-12 12:48:02 +00:00
|
|
|
];
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
|
2024-01-13 08:15:51 +00:00
|
|
|
darwin.apple_sdk.frameworks.AppKit
|
2023-04-12 12:48:02 +00:00
|
|
|
darwin.apple_sdk.frameworks.CoreFoundation
|
|
|
|
darwin.apple_sdk.frameworks.Security
|
|
|
|
];
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion ./scripts/completions/aichat.{bash,fish,zsh}
|
|
|
|
'';
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
meta = with lib; {
|
2024-01-13 08:15:51 +00:00
|
|
|
description = "Use GPT-4(V), Gemini, LocalAI, Ollama and other LLMs in the terminal";
|
2023-04-12 12:48:02 +00:00
|
|
|
homepage = "https://github.com/sigoden/aichat";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ mwdomino ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "aichat";
|
2023-04-12 12:48:02 +00:00
|
|
|
};
|
|
|
|
}
|