depot/third_party/nixpkgs/pkgs/by-name/ch/chatgpt-shell-cli/package.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

48 lines
1,006 B
Nix

{ lib
, stdenv
, fetchFromGitHub
, jq
, curl
, glow
, makeWrapper
}:
let
pname = "chatgpt-shell-cli";
# no tags
version = "master";
in
stdenv.mkDerivation {
inherit pname version;
src = fetchFromGitHub {
owner = "0xacx";
repo = "chatgpt-shell-cli";
rev = version;
hash = "sha256-hYLrUya4UCsIB1J/n+jp1jFRCEqnGFJOr3ATxm0zwdY=";
};
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install -Dm755 chatgpt.sh -t $out/bin
runHook postInstall
'';
postInstall = ''
wrapProgram $out/bin/chatgpt.sh \
--prefix PATH : ${lib.makeBinPath [ jq curl glow ]}
'';
meta = with lib; {
homepage = "https://github.com/0xacx/chatGPT-shell-cli";
description = "Simple shell script to use OpenAI's ChatGPT and DALL-E from the terminal. No Python or JS required.";
license = licenses.mit;
maintainers = with maintainers; [ jfvillablanca ];
};
}