about summary refs log tree commit diff
path: root/pkgs/by-name/sh
diff options
context:
space:
mode:
authorFabian Affolter <mail@fabian-affolter.ch>2024-04-29 10:29:57 +0200
committerFabian Affolter <mail@fabian-affolter.ch>2024-04-29 10:29:57 +0200
commit63b0fa4b600f97d926167dd0534af6157fcde551 (patch)
tree76a5cd78dae5af1c529741a2d9aad9a23843b011 /pkgs/by-name/sh
parentb1b82c7b4747b8063b38b58ca4f90e7f2aa8767f (diff)
shell_gpt: move to pkgs/by-name
Diffstat (limited to 'pkgs/by-name/sh')
-rw-r--r--pkgs/by-name/sh/shell-gpt/package.nix48
1 files changed, 48 insertions, 0 deletions
diff --git a/pkgs/by-name/sh/shell-gpt/package.nix b/pkgs/by-name/sh/shell-gpt/package.nix
new file mode 100644
index 0000000000000..4db72ae505864
--- /dev/null
+++ b/pkgs/by-name/sh/shell-gpt/package.nix
@@ -0,0 +1,48 @@
+{ lib
+, python3
+, fetchPypi
+, nix-update-script
+}:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "shell_gpt";
+  version = "1.4.3";
+  pyproject = true;
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "sha256-zSgWSC60ypOQ1IENcxObBezAfHosQWBD9ft06yh5iV4=";
+  };
+
+  nativeBuildInputs = with python3.pkgs; [
+    python3.pkgs.pythonRelaxDepsHook
+    python3
+    pip
+  ];
+
+  propagatedBuildInputs = with python3.pkgs; [
+    markdown-it-py
+    rich
+    distro
+    typer
+    requests
+    hatchling
+    openai
+    instructor
+  ];
+
+  pythonRelaxDeps = [ "requests" "rich" "distro" "typer" ];
+
+  passthru.updateScript = nix-update-script { };
+
+  doCheck = false;
+
+  meta = with lib; {
+    mainProgram = "sgpt";
+    homepage = "https://github.com/TheR1D/shell_gpt";
+    description = "Access ChatGPT from your terminal";
+    platforms = platforms.unix;
+    license = licenses.mit;
+    maintainers = with maintainers; [ mglolenstine ];
+  };
+}