36 lines
839 B
Nix
36 lines
839 B
Nix
{...}: {
|
|
services.secrets = {
|
|
enable = true;
|
|
|
|
vaultLogin = {
|
|
enable = true;
|
|
loginUsername = "hetzner-arm-container-postgresql";
|
|
};
|
|
|
|
requiredVaultPaths = [
|
|
"api-keys/data/backblaze/Chaos-Backups"
|
|
"private-public-keys/data/restic/PostgreSQL"
|
|
];
|
|
|
|
secrets = {
|
|
vault_password = {
|
|
manual = true;
|
|
};
|
|
|
|
restic_password = {
|
|
fetchScript = ''
|
|
simple_get "/private-public-keys/restic/PostgreSQL" .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
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
}
|