45 lines
1.1 KiB
Nix
45 lines
1.1 KiB
Nix
{...}: {
|
|
services.secrets = {
|
|
enable = true;
|
|
|
|
vaultLogin = {
|
|
enable = true;
|
|
loginUsername = "hetzner-arm-container-social";
|
|
};
|
|
|
|
requiredVaultPaths = [
|
|
"private-public-keys/data/restic/Social"
|
|
|
|
"api-keys/data/backblaze/Chaos-Backups"
|
|
|
|
"api-keys/data/chaos_mail/gotosocial"
|
|
];
|
|
|
|
secrets = {
|
|
vault_password = {
|
|
manual = true;
|
|
};
|
|
|
|
restic_password = {
|
|
fetchScript = ''
|
|
simple_get "/private-public-keys/restic/Social" .password > "$secretFile"
|
|
'';
|
|
};
|
|
restic_env = {
|
|
fetchScript = ''
|
|
cat << EOF > "$secretFile"
|
|
AWS_ACCESS_KEY_ID=$(simple_get "/api-keys/backblaze/Chaos-Backups" .keyID)
|
|
AWS_SECRET_ACCESS_KEY=$(simple_get "/api-keys/backblaze/Chaos-Backups" .applicationKey)
|
|
EOF
|
|
'';
|
|
};
|
|
env_secrets = {
|
|
fetchScript = ''
|
|
smtp_password=$(simple_get "/api-keys/chaos_mail/gotosocial" .password)
|
|
echo "GTS_SMTP_PASSWORD=$smtp_password" > "$secretFile"
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
}
|