2022-11-28 10:09:25 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: {
|
2022-11-27 09:43:23 +00:00
|
|
|
services.peertube = {
|
|
|
|
enable = true;
|
|
|
|
localDomain = "peertube.chir.rs";
|
|
|
|
listenHttp = 5370;
|
2022-11-27 13:43:41 +00:00
|
|
|
listenWeb = 443;
|
|
|
|
enableWebHttps = true;
|
2022-11-27 09:43:23 +00:00
|
|
|
serviceEnvironmentFile = config.sops.secrets."services/peertube".path;
|
|
|
|
settings = {
|
|
|
|
object_storage = {
|
|
|
|
enabled = true;
|
2022-11-27 19:22:21 +00:00
|
|
|
endpoint = "s3.us-west-000.backblazeb2.com";
|
2022-11-27 09:43:23 +00:00
|
|
|
videos = {
|
|
|
|
bucket_name = "mastodon-chir-rs";
|
|
|
|
prefix = "peertube/videos/";
|
|
|
|
base_url = "https://mastodon-assets.chir.rs/";
|
|
|
|
};
|
|
|
|
streaming_playlists = {
|
|
|
|
bucket_name = "mastodon-chir-rs";
|
|
|
|
prefix = "peertube/streaming-playlists/";
|
|
|
|
base_url = "https://mastodon-assets.chir.rs/";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
database.createLocally = true;
|
|
|
|
redis.createLocally = true;
|
|
|
|
};
|
2022-11-28 10:09:25 +00:00
|
|
|
systemd.services.peertube.path = with pkgs; lib.mkForce [bashInteractive ffmpeg_5 nodejs-16_x openssl yarn python3 coreutils systemd];
|
2022-11-27 09:43:23 +00:00
|
|
|
services.caddy.virtualHosts."peertube.chir.rs" = {
|
|
|
|
useACMEHost = "chir.rs";
|
|
|
|
extraConfig = ''
|
|
|
|
import baseConfig
|
|
|
|
reverse_proxy {
|
|
|
|
to http://127.0.0.1:5370
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
sops.secrets."services/peertube".owner = "peertube";
|
|
|
|
}
|