diff --git a/pkgs/development/python-modules/tree-sitter/default.nix b/pkgs/development/python-modules/tree-sitter/default.nix new file mode 100644 index 000000000000..541051c8690c --- /dev/null +++ b/pkgs/development/python-modules/tree-sitter/default.nix @@ -0,0 +1,41 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pytestCheckHook +, pythonOlder +, setuptools +, wheel +}: + +buildPythonPackage rec { + pname = "tree-sitter"; + version = "0.20.1"; + format = "pyproject"; + + disabled = pythonOlder "3.7"; + + src = fetchPypi { + pname = "tree_sitter"; + inherit version; + hash = "sha256-6T8ILFRdZkm8+11oHtJV6wBKbOIpiJcaEo9AaS/uxg0="; + }; + + nativeBuildInputs = [ + setuptools + wheel + ]; + + # PyPI tarball doesn't contains tests and source has additional requirements + doCheck = false; + + pythonImportsCheck = [ + "tree_sitter" + ]; + + meta = with lib; { + description = "Python bindings to the Tree-sitter parsing library"; + homepage = "https://github.com/tree-sitter/py-tree-sitter"; + license = licenses.mit; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/tools/security/zeekscript/default.nix b/pkgs/tools/security/zeekscript/default.nix new file mode 100644 index 000000000000..cf5e44ea8f68 --- /dev/null +++ b/pkgs/tools/security/zeekscript/default.nix @@ -0,0 +1,35 @@ +{ lib +, python3 +, fetchPypi +}: + +python3.pkgs.buildPythonApplication rec { + pname = "zeekscript"; + version = "1.2.1"; + format = "pyproject"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-LogI9sJHvLN5WHJGdW47D09XZInKln/I2hNmG62d1JU="; + }; + + nativeBuildInputs = with python3.pkgs; [ + setuptools + ]; + + propagatedBuildInputs = with python3.pkgs; [ + tree-sitter + ]; + + pythonImportsCheck = [ + "zeekscript" + ]; + + meta = with lib; { + description = "A Zeek script formatter and analyzer"; + homepage = "https://github.com/zeek/zeekscript"; + changelog = "https://github.com/zeek/zeekscript/blob/v${version}/CHANGES"; + license = licenses.bsd3; + maintainers = with maintainers; [ fab tobim ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a5ca6bc33c23..20b0c0fe12b0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7123,6 +7123,8 @@ with pkgs; zeek = callPackage ../applications/networking/ids/zeek { }; + zeekscript = callPackage ../tools/security/zeekscript { }; + zoekt = callPackage ../tools/text/zoekt { }; zonemaster-cli = perlPackages.ZonemasterCLI; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index e856ddb72bcd..a48d825f8fb4 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11965,6 +11965,8 @@ self: super: with self; { trectools = callPackage ../development/python-modules/trectools { }; + tree-sitter = callPackage ../development/python-modules/tree-sitter { }; + treelog = callPackage ../development/python-modules/treelog { }; treeo = callPackage ../development/python-modules/treeo { };