2022-12-04 16:10:00 +00:00
|
|
|
{...}: {
|
2022-11-17 22:25:41 +00:00
|
|
|
services.secrets = {
|
|
|
|
enable = true;
|
2023-09-14 13:54:56 +01:00
|
|
|
|
2023-09-18 03:56:58 +01:00
|
|
|
vaultLogin = {
|
|
|
|
enable = true;
|
|
|
|
loginUsername = "vault";
|
|
|
|
};
|
|
|
|
|
|
|
|
autoSecrets = {
|
|
|
|
enable = true;
|
|
|
|
};
|
|
|
|
|
2023-09-14 13:54:56 +01:00
|
|
|
requiredVaultPaths = [
|
|
|
|
"private-public-keys/data/restic/Vault"
|
|
|
|
|
|
|
|
"api-keys/data/storage/restic/Vault"
|
|
|
|
];
|
|
|
|
|
2022-11-17 22:25:41 +00:00
|
|
|
secrets = {
|
2023-09-18 03:56:58 +01:00
|
|
|
vault_password = {
|
|
|
|
manual = true;
|
|
|
|
};
|
|
|
|
|
2022-11-17 22:25:41 +00:00
|
|
|
restic_password = {
|
|
|
|
fetchScript = ''
|
2023-09-11 23:22:18 +01:00
|
|
|
simple_get "/private-public-keys/restic/Vault" .password > "$secretFile"
|
2022-11-17 22:25:41 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
restic_env = {
|
|
|
|
fetchScript = ''
|
|
|
|
RESTIC_USERNAME=$(simple_get "/api-keys/storage/restic/Vault" .username)
|
|
|
|
RESTIC_PASSWORD=$(simple_get "/api-keys/storage/restic/Vault" .password)
|
2023-09-11 23:22:18 +01:00
|
|
|
echo "RESTIC_REPOSITORY=rest:https://$RESTIC_USERNAME:$RESTIC_PASSWORD@storage-restic.owo.monster/Vault" > "$secretFile"
|
2022-11-17 22:25:41 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2022-11-02 10:24:47 +00:00
|
|
|
}
|