{ config, lib, pkgs, ... }: let cfg = config.vhack.peertube; in { options.vhack.peertube = { enable = lib.mkEnableOption '' the peertube video platform. ''; }; config = lib.mkIf cfg.enable { services.peertube = { enable = true; localDomain = "peertube.vhack.eu"; configureNginx = true; smtp = { createLocally = true; passwordFile = "${config.age.secrets.peertubeSmtp.path}"; }; database = { createLocally = true; }; redis = { enableUnixSocket = true; createLocally = true; }; secrets.secretsFile = "${config.age.secrets.peertubeGeneral.path}"; }; age.secrets = { peertubeGeneral = { file = ./secrets/general.age; mode = "700"; owner = "peertube"; group = "peertube"; }; peertubeSmtp = { file = ./secrets/smtp.age; mode = "700"; owner = "peertube"; group = "peertube"; }; }; environment.persistence."/srv".directories = [ { directory = "/var/lib/peertube"; user = "peertube"; group = "peertube"; mode = "0700"; } ]; }; }