about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/xkcdpass/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/xkcdpass/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/xkcdpass/default.nix50
1 files changed, 50 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/xkcdpass/default.nix b/nixpkgs/pkgs/development/python-modules/xkcdpass/default.nix
new file mode 100644
index 000000000000..d4a04317ad80
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/xkcdpass/default.nix
@@ -0,0 +1,50 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, installShellFiles
+, pytestCheckHook
+, pythonAtLeast
+, pythonOlder
+}:
+
+buildPythonPackage rec {
+  pname = "xkcdpass";
+  version = "1.19.6";
+  format = "setuptools";
+
+  disabled = pythonOlder "3.7";
+
+  src = fetchPypi {
+    inherit pname version;
+    hash = "sha256-zrdR4KuORCGIoRTZDednT9JDV/seWQRa3aPal8gxdTE=";
+  };
+
+  nativeBuildInputs = [
+    installShellFiles
+  ];
+
+  nativeCheckInputs = [
+    pytestCheckHook
+  ];
+
+  pythonImportsCheck = [
+    "xkcdpass"
+  ];
+
+  disabledTests = lib.optionals (pythonAtLeast "3.10") [
+    # https://github.com/redacted/XKCD-password-generator/issues/138
+    "test_entropy_printout_valid_input"
+  ];
+
+  postInstall = ''
+    installManPage *.?
+    install -Dm444 -t $out/share/doc/${pname} README*
+  '';
+
+  meta = with lib; {
+    description = "Generate secure multiword passwords/passphrases, inspired by XKCD";
+    homepage = "https://github.com/redacted/XKCD-password-generator";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ peterhoeg ];
+  };
+}