2020-07-01 22:29:35 +02:00
|
|
|
# Utility for invoking slappasswd with the correct options for
|
|
|
|
# creating an ARGON2 password hash.
|
2021-04-13 12:21:42 +02:00
|
|
|
{ pkgs, ... }:
|
2020-07-01 22:29:35 +02:00
|
|
|
|
2022-05-28 00:58:05 +02:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
})
|