nixos-config/modules/nitter.nix

46 lines
913 B
Nix
Raw Permalink Normal View History

2022-08-01 15:27:21 +02:00
{ lib, ... }:
2022-01-27 17:14:52 +01:00
let
domain = "t.mc-fucker.cool";
2022-08-01 15:27:21 +02:00
nitter_port = "23145";
2022-09-25 01:48:32 +02:00
redis_port = 56379;
2022-01-27 17:14:52 +01:00
in
{
services.nitter = {
enable = true;
openFirewall = true;
2022-09-25 01:48:32 +02:00
redisCreateLocally = false;
cache = {
listMinutes = 480;
#redisPort = redis_port;
};
2022-01-27 17:14:52 +01:00
server = {
hostname = domain;
https = true;
2022-08-01 15:27:21 +02:00
port = (lib.strings.toInt nitter_port);
2022-01-27 17:14:52 +01:00
};
preferences = {
hlsPlayback = true;
infiniteScroll = true;
replaceTwitter = domain;
replaceYouTube = "y${domain}";
};
};
2022-08-01 15:27:21 +02:00
services.nginx.virtualHosts."${domain}" = {
forceSSL = true;
enableACME = true;
locations = {
"/" = {
proxyPass = "http://127.0.0.1:${nitter_port}";
};
};
2022-11-24 18:22:26 +01:00
extraConfig = ''
access_log /var/log/nginx/${domain}_access.log;
error_log /var/log/nginx/${domain}_error.log;
'';
2022-08-01 15:27:21 +02:00
};
2022-01-27 17:14:52 +01:00
}
# vim: set et ts=2 sw=2 ai: