43 lines
1,007 B
Nix
43 lines
1,007 B
Nix
{pkgs, ...}: {
|
|
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"
|
|
];
|
|
|
|
packages = with pkgs; [
|
|
apacheHttpd
|
|
];
|
|
|
|
secrets = {
|
|
vault_password = {
|
|
manual = true;
|
|
};
|
|
|
|
restic_password = {
|
|
fetchScript = ''
|
|
simple_get "/private-public-keys/restic/Forgejo" .password > "$secretFile"
|
|
'';
|
|
};
|
|
restic_env = {
|
|
fetchScript = ''
|
|
RESTIC_USERNAME=$(simple_get "/api-keys/storage/restic/Forgejo" .username)
|
|
RESTIC_PASSWORD=$(simple_get "/api-keys/storage/restic/Forgejo" .password)
|
|
echo "RESTIC_REPOSITORY=rest:https://$RESTIC_USERNAME:$RESTIC_PASSWORD@storage-restic.owo.monster/Forgejo" > "$secretFile"
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
}
|