Add argon2id app

This commit is contained in:
Jakob Lechner 2023-06-27 12:30:53 +00:00
parent f04e802509
commit 727e3c1af4
No known key found for this signature in database
GPG key ID: 996082EFB5906C10

View file

@ -100,9 +100,29 @@
}
)
self.nixosConfigurations);
argon2id =
let
python = pkgs.python3.withPackages (pp: with pp; [
argon2-cffi
]);
in
pkgs.writeTextFile {
name = "argon2id";
text = ''
#!${python}/bin/python
import getpass
from argon2 import PasswordHasher
pw = getpass.getpass()
ph = PasswordHasher(
time_cost=5,
memory_cost=2*1024*1024, # in kibibytes
parallelism=4,
)
print(ph.hash(pw))
'';
executable = true;
};
});
}) // {
overlay = import ./pkgs;