simple-nixos-fediverse/peertube.nix

40 lines
1 KiB
Nix
Raw Normal View History

2024-03-20 00:43:20 +01:00
{ config, lib, pkgs, ... }: {
networking.firewall.allowedTCPPorts = [ 80 9000 ];
# these configurations only apply when producing a VM (e.g. nixos-rebuild build-vm)
virtualisation.vmVariant = { config, ... }: {
services.peertube = {
enable = true;
# redirects to localhost, but allows it to have a proper domain name
localDomain = "peertube.localhost";
enableWebHttps = false;
settings = {
listen.hostname = "0.0.0.0";
instance.name = "PeerTube Test VM";
};
# TODO: use agenix
secrets.secretsFile = pkgs.runCommand "secret-gen" {
nativeBuildInputs = [ pkgs.openssl ];
} ''
openssl rand -hex 32 > $out
'';
redis.createLocally = true;
database.createLocally = true;
configureNginx = true;
};
virtualisation.forwardPorts = [
{
from = "host";
host.port = 9000;
guest.port = 9000;
}
{
from = "host";
host.port = 2222;
guest.port = 22;
}
];
};
}