1
1
Fork 1
mirror of https://github.com/oddlama/nix-config.git synced 2025-10-10 23:00:39 +02:00

feat: add other mail domains, autogenerate argon hashes

This commit is contained in:
oddlama 2024-07-31 19:54:49 +02:00
parent a128dd5f40
commit 76163bad98
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
51 changed files with 284 additions and 51 deletions

View file

@ -42,6 +42,22 @@
|| die "Failure while aggregating basic auth hashes"
'');
age.generators.argon2id = {
pkgs,
lib,
decrypt,
deps,
...
}: let
dep = builtins.head deps;
in ''
echo " -> Deriving argon2id hash from "${lib.escapeShellArg dep.host}":"${lib.escapeShellArg dep.name}"" >&2
${decrypt} ${lib.escapeShellArg dep.file} \
| tr -d '\n' \
| ${pkgs.libargon2}/bin/argon2 "$(${pkgs.openssl}/bin/openssl rand -base64 16)" -id \
|| die "Failure while generating argon2id hash"
'';
# Just before switching, remove the agenix directory if it exists.
# This can happen when a secret is used in the initrd because it will
# then be copied to the initramfs under the same path. This materializes