diff --git a/pkgs/by-name/ai/aichat/package.nix b/pkgs/by-name/ai/aichat/package.nix index bb971c677d45..a1d7adc32900 100644 --- a/pkgs/by-name/ai/aichat/package.nix +++ b/pkgs/by-name/ai/aichat/package.nix @@ -1,45 +1,51 @@ -{ lib -, stdenv -, darwin -, rustPlatform -, fetchFromGitHub -, pkg-config -, installShellFiles +{ + lib, + rustPlatform, + fetchFromGitHub, + pkg-config, + installShellFiles, + versionCheckHook, + nix-update-script, }: rustPlatform.buildRustPackage rec { pname = "aichat"; - version = "0.26.0"; + version = "0.27.0"; src = fetchFromGitHub { owner = "sigoden"; repo = "aichat"; - rev = "v${version}"; - hash = "sha256-Hqrwko/HZTHlKzXuqm835fpygOO9wsQx1XkJddH/EUc="; + tag = "v${version}"; + hash = "sha256-rKvnbauJpyZnJuLtGSjJKwe9wy/y/KLPyorH5u9t0H8="; }; - cargoHash = "sha256-4CcwzaPIO+upISizpXHGYfKh9YD4foJAqx7TGgLCHZI="; + useFetchCargoVendor = true; + cargoHash = "sha256-WtEV+JkSaegshF8VB/OfuvnnKX5hDshCC/v5B2McA6M="; nativeBuildInputs = [ pkg-config installShellFiles ]; - buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ - darwin.apple_sdk.frameworks.AppKit - darwin.apple_sdk.frameworks.CoreFoundation - darwin.apple_sdk.frameworks.Security - ]; - postInstall = '' installShellCompletion ./scripts/completions/aichat.{bash,fish,zsh} ''; - meta = with lib; { + nativeInstallCheckInputs = [ + versionCheckHook + ]; + versionCheckProgramArg = [ "--version" ]; + doInstallCheck = true; + + passthru = { + updateScript = nix-update-script { }; + }; + + meta = { description = "Use GPT-4(V), Gemini, LocalAI, Ollama and other LLMs in the terminal"; homepage = "https://github.com/sigoden/aichat"; - license = licenses.mit; - maintainers = with maintainers; [ mwdomino ]; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ mwdomino ]; mainProgram = "aichat"; }; }