Files
nixpkgs/pkgs/by-name/ch/chatgpt-shell-cli/package.nix
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

56 lines
1016 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";
tag = 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 = {
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 = lib.licenses.mit;
maintainers = with lib.maintainers; [ jfvillablanca ];
};
}