secrets: move into 'modules'
This commit is contained in:
parent
a62c0ad126
commit
fec4956063
30 changed files with 1 additions and 2 deletions
21
modules/secrets/sso/default.nix
Normal file
21
modules/secrets/sso/default.nix
Normal 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" ];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue