2023-07-21 11:48:07 +01:00
|
|
|
{...}: {
|
|
|
|
services.secrets = {
|
|
|
|
enable = true;
|
|
|
|
secrets = {
|
2023-09-18 15:40:33 +01:00
|
|
|
usb_encryption_passphrase = {
|
|
|
|
manual = true;
|
|
|
|
};
|
2023-08-01 18:48:59 +01:00
|
|
|
|
2023-07-21 11:48:07 +01:00
|
|
|
music_stream_password = {
|
2023-09-21 05:06:27 +01:00
|
|
|
user = "chaos";
|
2023-07-21 11:48:07 +01:00
|
|
|
group = "users";
|
|
|
|
fetchScript = ''
|
2023-09-11 23:22:18 +01:00
|
|
|
simple_get "/api-keys/music-stream" .password > "$secretFile"
|
2023-07-21 11:48:07 +01:00
|
|
|
'';
|
|
|
|
};
|
2023-08-01 18:48:59 +01:00
|
|
|
|
2023-09-19 17:53:44 +01:00
|
|
|
# Required for home.apps.manualBackupApps
|
2023-08-01 18:48:59 +01:00
|
|
|
restic_music_env = {
|
|
|
|
user = "chaos";
|
|
|
|
fetchScript = ''
|
2023-10-10 22:22:54 +01:00
|
|
|
api_username=restic
|
|
|
|
api_password=$(simple_get "/api-keys/storage/restic/Music" ".$api_username")
|
2023-08-01 18:48:59 +01:00
|
|
|
restic_password=$(simple_get "/private-public-keys/restic/Music" .password)
|
|
|
|
|
2023-09-11 23:22:18 +01:00
|
|
|
echo > "$secretFile"
|
2023-10-10 22:22:54 +01:00
|
|
|
echo "RESTIC_REPOSITORY=rest:https://$api_username:$api_password@storage-restic.owo.monster/Music" >> "$secretFile"
|
2023-09-11 23:22:18 +01:00
|
|
|
echo "RESTIC_PASSWORD=''${restic_password}" >> "$secretFile"
|
2023-08-01 18:48:59 +01:00
|
|
|
'';
|
|
|
|
};
|
2024-03-10 17:17:05 +00:00
|
|
|
|
|
|
|
restic_backups_password = {
|
|
|
|
fetchScript = ''
|
|
|
|
simple_get "/private-public-keys/restic/Lappy-T495" .password >> "$secretFile"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
restic_backups_repository_file = {
|
|
|
|
fetchScript = ''
|
|
|
|
api_username=restic
|
|
|
|
api_password=$(simple_get "/api-keys/storage/restic/Lappy-T495" ".$api_username")
|
|
|
|
|
|
|
|
echo "rest:https://$api_username:$api_password@storage-restic.owo.monster/Lappy-T495" > "$secretFile"
|
|
|
|
'';
|
|
|
|
};
|
2023-07-21 11:48:07 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|