diff --git a/pkgs/llm/llm-cmd/default.nix b/pkgs/llm/llm-cmd/default.nix new file mode 100644 index 0000000..1b4293e --- /dev/null +++ b/pkgs/llm/llm-cmd/default.nix @@ -0,0 +1,37 @@ +{ + buildPythonPackage, + fetchFromGitHub, + + # build-system + setuptools, + wheel, + + # deps + prompt_toolkit, + pygments, + ... +}: + +buildPythonPackage rec { + pname = "llm-cmd"; + version = "0.2a0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "simonw"; + repo = "llm-cmd"; + rev = version; + hash = "sha256-RhwQEllpee/XP1p0nrgL4m+KjSZzf61J8l1jJGlg94E="; + }; + + nativeBuildInputs = [ + setuptools + wheel + ]; + + dependencies = [ + prompt_toolkit pygments + ]; + + dontCheckRuntimeDeps = true; +} diff --git a/pkgs/llm/llm-jq/default.nix b/pkgs/llm/llm-jq/default.nix new file mode 100644 index 0000000..aad8309 --- /dev/null +++ b/pkgs/llm/llm-jq/default.nix @@ -0,0 +1,30 @@ +{ + buildPythonPackage, + fetchFromGitHub, + + # build-system + setuptools, + wheel, + + ... +}: + +buildPythonPackage rec { + pname = "llm-jq"; + version = "0.1.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "simonw"; + repo = "llm-jq"; + rev = version; + hash = "sha256-Mf/tbB9+UdmSRpulqv5Wagr8wjDcRrNs2741DNQZhO4="; + }; + + nativeBuildInputs = [ + setuptools + wheel + ]; + + dontCheckRuntimeDeps = true; +} diff --git a/pkgs/llm/llm-with-plugins/default.nix b/pkgs/llm/llm-with-plugins/default.nix index 3477b58..f18847f 100644 --- a/pkgs/llm/llm-with-plugins/default.nix +++ b/pkgs/llm/llm-with-plugins/default.nix @@ -5,15 +5,23 @@ let inherit (pkgs) python3Packages; llm = python3Packages.callPackage ../llm { }; - llm-anthropic = python3Packages.callPackage ../llm-anthropic { }; - llm-gemini = python3Packages.callPackage ../llm-gemini { }; + plugins = [ + "anthropic" + "gemini" + "cmd" + "jq" + ]; + + pluginPackages = plugins |> map (name: python3Packages.callPackage (../. + "/llm-${name}") { }); pyWithLlm = ( - pkgs.python3.withPackages (_: [ - llm - llm-anthropic - llm-gemini - ]) + pkgs.python3.withPackages ( + _: + [ + llm + ] + ++ pluginPackages + ) ); in pkgs.writeShellScriptBin "llm" ''