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.nix14
1 files changed, 11 insertions, 3 deletions
diff --git a/tools/hash-password.nix b/tools/hash-password.nix
index 9893d521787e..6192436c17b9 100644
--- a/tools/hash-password.nix
+++ b/tools/hash-password.nix
@@ -2,6 +2,14 @@
 # creating an ARGON2 password hash.
 { pkgs, ... }:
 
-pkgs.writeShellScriptBin "hash-password" ''
-  ${pkgs.openldap}/bin/slappasswd -o module-load=pw-argon2 -h '{ARGON2}'
-''
+let
+  script = pkgs.writeShellScriptBin "hash-password" ''
+    ${pkgs.openldap}/bin/slappasswd -o module-load=argon2 -h '{ARGON2}' "$@"
+  '';
+in
+script.overrideAttrs (old: {
+  doCheck = true;
+  checkPhase = ''
+    ${pkgs.stdenv.shell} $out/bin/hash-password -s example-password > /dev/null
+  '';
+})