about summary refs log tree commit diff
path: root/tools/hash-password.nix
diff options
context:
space:
mode:
Diffstat (limited to 'tools/hash-password.nix')
-rw-r--r--tools/hash-password.nix7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/hash-password.nix b/tools/hash-password.nix
new file mode 100644
index 000000000000..9893d521787e
--- /dev/null
+++ b/tools/hash-password.nix
@@ -0,0 +1,7 @@
+# Utility for invoking slappasswd with the correct options for
+# creating an ARGON2 password hash.
+{ pkgs, ... }:
+
+pkgs.writeShellScriptBin "hash-password" ''
+  ${pkgs.openldap}/bin/slappasswd -o module-load=pw-argon2 -h '{ARGON2}'
+''