summary refs log tree commit diff
path: root/pkgs/tools/security/pwgen-secure/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/security/pwgen-secure/default.nix')
-rw-r--r--pkgs/tools/security/pwgen-secure/default.nix36
1 files changed, 36 insertions, 0 deletions
diff --git a/pkgs/tools/security/pwgen-secure/default.nix b/pkgs/tools/security/pwgen-secure/default.nix
new file mode 100644
index 00000000000..c3141676b37
--- /dev/null
+++ b/pkgs/tools/security/pwgen-secure/default.nix
@@ -0,0 +1,36 @@
+{ lib, python3Packages, fetchFromGitHub }:
+
+with python3Packages;
+
+buildPythonApplication rec {
+  pname = "pwgen-secure";
+  version = "0.9.1";
+
+  # it needs `secrets` which was introduced in 3.6
+  disabled = pythonOlder "3.6";
+
+  # GH is newer than Pypi and contains both library *and* the actual program
+  # whereas Pypi only has the library
+  src = fetchFromGitHub {
+    owner = "mjmunger";
+    repo = "pwgen_secure";
+    rev = "v${version}";
+    sha256 = "15md5606hzy1xfhj2lxmc0nvynyrcs4vxa5jdi34kfm31rdklj28";
+  };
+
+  propagatedBuildInputs = [ docopt ];
+
+  postInstall = ''
+    install -Dm755 spwgen.py $out/bin/spwgen
+  '';
+
+  # there are no checks
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Secure password generation library to replace pwgen";
+    homepage = "https://github.com/mjmunger/pwgen_secure/";
+    license = licenses.mit;
+    maintainers = with maintainers; [ peterhoeg ];
+  };
+}