about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWesley Jr <dev@wesleyjrz.com>2023-02-26 18:37:46 -0300
committerWesley Jr <dev@wesleyjrz.com>2023-03-02 09:53:24 -0300
commitd2b3adf3bc07582fec3c3aa29dabb9630ad2dd30 (patch)
tree3f80c13a55561cf7b0dff51b8cdf5c08c6fb242f
parent63576d1c14524eb186c097c733f130d9ec7c71bd (diff)
kb: init at 0.1.7
-rw-r--r--pkgs/tools/misc/kb/default.nix58
-rw-r--r--pkgs/top-level/all-packages.nix2
2 files changed, 60 insertions, 0 deletions
diff --git a/pkgs/tools/misc/kb/default.nix b/pkgs/tools/misc/kb/default.nix
new file mode 100644
index 0000000000000..76db4d7deca4d
--- /dev/null
+++ b/pkgs/tools/misc/kb/default.nix
@@ -0,0 +1,58 @@
+{ lib
+, fetchFromGitHub
+, python3
+}:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "kb";
+  version = "0.1.7";
+  format = "setuptools";
+
+  src = fetchFromGitHub {
+    owner = "gnebbia";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-K8EAqZbl2e0h03fFwaKIclZTZARDQp1tRo44znxwW0I=";
+  };
+
+  postPatch = ''
+    # `attr` module is not available. And `attrs` defines another `attr` package
+    # that shadows it.
+    substituteInPlace setup.py \
+      --replace \
+        "install_requires=[\"colored\",\"toml\",\"attr\",\"attrs\",\"gitpython\"]," \
+        "install_requires=[\"colored\",\"toml\",\"attrs\",\"gitpython\"],"
+
+    # pytest coverage reporting isn't necessary
+    substituteInPlace setup.cfg \
+      --replace \
+      "addopts = --cov=kb --cov-report term-missing" ""
+  '';
+
+  propagatedBuildInputs = with python3.pkgs; [
+    colored
+    toml
+    attrs
+    gitpython
+  ];
+
+  nativeCheckInputs = with python3.pkgs; [
+    pytestCheckHook
+  ];
+
+  meta = with lib; {
+    description = "A minimalist command line knowledge base manager";
+    longDescription = ''
+      kb is a text-oriented minimalist command line knowledge base manager. kb
+      can be considered a quick note collection and access tool oriented toward
+      software developers, penetration testers, hackers, students or whoever has
+      to collect and organize notes in a clean way. Although kb is mainly
+      targeted on text-based note collection, it supports non-text files as well
+      (e.g., images, pdf, videos and others).
+    '';
+    homepage = "https://github.com/gnebbia/kb";
+    changelog = "https://github.com/gnebbia/kb/blob/v${version}/CHANGELOG.md";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ wesleyjrz ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 51c87b6f9859f..8d017c8d5312c 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -10229,6 +10229,8 @@ with pkgs;
 
   nb = callPackage ../tools/misc/nb { };
 
+  kb = callPackage ../tools/misc/kb { };
+
   notable = callPackage ../applications/misc/notable { };
 
   nth = with python3Packages; toPythonApplication name-that-hash;