2024-05-24 18:58:21 +01:00
|
|
|
{pkgs, ...}: {
|
|
|
|
services.secrets = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
packages = with pkgs; [
|
|
|
|
apacheHttpd
|
|
|
|
];
|
|
|
|
|
|
|
|
vaultLogin = {
|
|
|
|
enable = true;
|
2024-07-06 17:20:28 +01:00
|
|
|
loginUsername = "hetzner-arm-container-vault";
|
2024-05-24 18:58:21 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
requiredVaultPaths = [
|
|
|
|
"private-public-keys/data/restic/Vault"
|
|
|
|
|
2024-07-06 17:20:28 +01:00
|
|
|
"api-keys/data/backblaze/Chaos-Backups"
|
2024-05-24 18:58:21 +01:00
|
|
|
|
|
|
|
"infra/data/internalCAPassword"
|
|
|
|
];
|
|
|
|
|
|
|
|
secrets = {
|
|
|
|
vault_password = {
|
|
|
|
manual = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
restic_password = {
|
|
|
|
fetchScript = ''
|
|
|
|
simple_get "/private-public-keys/restic/Vault" .password > "$secretFile"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
restic_env = {
|
|
|
|
fetchScript = ''
|
2024-07-06 17:20:28 +01:00
|
|
|
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
|
2024-05-24 18:58:21 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
internal_ca_password = {
|
|
|
|
fetchScript = ''
|
|
|
|
simple_get "/infra/internalCAPassword" .password > "$secretFile"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|