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