39 lines
947 B
Nix
39 lines
947 B
Nix
|
{...}: {
|
||
|
services.secrets = {
|
||
|
enable = true;
|
||
|
|
||
|
vaultLogin = {
|
||
|
enable = true;
|
||
|
loginUsername = "hetzner-arm-container-quassel";
|
||
|
};
|
||
|
|
||
|
autoSecrets = {
|
||
|
enable = true;
|
||
|
};
|
||
|
|
||
|
requiredVaultPaths = [
|
||
|
"api-keys/data/storage/restic/Quassel"
|
||
|
"private-public-keys/data/restic/Quassel"
|
||
|
];
|
||
|
|
||
|
secrets = {
|
||
|
vault_password = {
|
||
|
manual = true;
|
||
|
};
|
||
|
|
||
|
restic_password = {
|
||
|
fetchScript = ''
|
||
|
simple_get "/private-public-keys/restic/Quassel" .password > "$secretFile"
|
||
|
'';
|
||
|
};
|
||
|
restic_env = {
|
||
|
fetchScript = ''
|
||
|
RESTIC_USERNAME=$(simple_get "/api-keys/storage/restic/Quassel" .username)
|
||
|
RESTIC_PASSWORD=$(simple_get "/api-keys/storage/restic/Quassel" .password)
|
||
|
echo "RESTIC_REPOSITORY=rest:https://$RESTIC_USERNAME:$RESTIC_PASSWORD@storage-restic.owo.monster/Quassel" > "$secretFile"
|
||
|
'';
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
}
|