tvl-depot/tools/hash-password.nix
Vincent Ambo 6e1ea80e5b docs(REVIEWS): point people to signup.tvl.fyi for account creation
Rather than invoking the old shell script, people can now use the web
UI to create the entry.

Change-Id: Ic1b065d219fde9977bb1d8ee59ce7ac5f27e2e29
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9306
Autosubmit: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
2023-09-12 13:59:34 +00:00

17 lines
477 B
Nix

# Utility for invoking slappasswd with the correct options for
# creating an ARGON2 password hash.
#
# Users should generally use https://signup.tvl.fyi instead.
{ pkgs, ... }:
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
'';
})