modules: secrets: move host-specific secrets

This commit is contained in:
Bruno BELANYI 2023-04-13 16:48:37 +00:00
parent 57008bcb7c
commit 6079485b50
27 changed files with 52 additions and 55 deletions

Binary file not shown.

View file

@ -0,0 +1,21 @@
{ lib }:
let
inherit (lib) fileContents;
importUser = (user: {
# bcrypt hashed: `htpasswd -BnC 10 ""`
passwordHash = fileContents (./. + "/${user}/password-hash.txt");
# base32 encoded: `printf '<secret>' | base32 | tr -d =`
totpSecret = fileContents (./. + "/${user}/totp-secret.txt");
});
in
{
auth_key = fileContents ./auth-key.txt;
users = lib.flip lib.genAttrs importUser [
"ambroisie"
];
groups = {
root = [ "ambroisie" ];
};
}