From 727e3c1af4584734c74a43b6f7bc559685f0e68a Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Tue, 27 Jun 2023 12:30:53 +0000 Subject: [PATCH] Add argon2id app --- flake.nix | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 2030274..a7e0939 100644 --- a/flake.nix +++ b/flake.nix @@ -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;