about summary refs log tree commit diff
path: root/pkgs/by-name/sh/shell-gpt/package.nix
blob: 92f451b24088f7dacc9a6ecac83727e59c470a42 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{
  lib,
  fetchFromGitHub,
  python3,
}:

python3.pkgs.buildPythonApplication rec {
  pname = "shell-gpt";
  version = "1.4.3";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "TheR1D";
    repo = "shell_gpt";
    rev = "refs/tags/${version}";
    hash = "sha256-T37L4U1kOrrIQJ2znq2UupD3pyit9xd8rAsEwUvGiQ8=";
  };

  pythonRelaxDeps = [
    "requests"
    "rich"
    "distro"
    "typer"
    "instructor"
  ];

  build-system = with python3.pkgs; [ hatchling ];

  nativeBuildInputs = with python3.pkgs; [ pythonRelaxDepsHook ];

  propagatedBuildInputs = with python3.pkgs; [
    click
    distro
    instructor
    openai
    rich
    typer
  ];

  # Tests want to read the OpenAI API key from stdin
  doCheck = false;

  meta = with lib; {
    description = "Access ChatGPT from your terminal";
    homepage = "https://github.com/TheR1D/shell_gpt";
    changelog = "https://github.com/TheR1D/shell_gpt/releases/tag/${version}";
    license = licenses.mit;
    maintainers = with maintainers; [ mglolenstine ];
    mainProgram = "sgpt";
  };
}