2024-01-23 05:24:47 +01:00
|
|
|
{ config, ... }:
|
2023-01-04 14:32:11 +01:00
|
|
|
{
|
2024-11-29 00:17:35 +01:00
|
|
|
sops = {
|
|
|
|
secrets = {
|
|
|
|
"osuchan/env/channel_access_token" = { };
|
|
|
|
"osuchan/env/channel_id" = { };
|
|
|
|
"osuchan/env/channel_secret" = { };
|
|
|
|
};
|
|
|
|
templates."osuchan.env" = {
|
|
|
|
restartUnits = [ "osuchan.service" ];
|
|
|
|
content = let
|
|
|
|
inherit (config.sops) placeholder;
|
|
|
|
in ''
|
|
|
|
CHANNEL_ACCESS_TOKEN=${placeholder."osuchan/env/channel_access_token"}
|
|
|
|
CHANNEL_ID=${placeholder."osuchan/env/channel_id"}
|
|
|
|
CHANNEL_SECRET=${placeholder."osuchan/env/channel_secret"}
|
|
|
|
'';
|
|
|
|
};
|
2024-01-23 05:24:47 +01:00
|
|
|
};
|
|
|
|
|
2023-01-04 14:32:11 +01:00
|
|
|
services.osuchan = {
|
|
|
|
enable = true;
|
2023-10-06 18:05:38 +02:00
|
|
|
port = 9283;
|
2024-11-29 00:17:35 +01:00
|
|
|
secretFile = config.sops.templates."osuchan.env".path;
|
2023-01-04 14:32:11 +01:00
|
|
|
};
|
|
|
|
}
|