nixos-config/modules/nitter.nix

48 lines
1.1 KiB
Nix
Raw 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-01-27 17:14:52 +01:00
in
{
services.nitter = {
enable = true;
openFirewall = true;
cache.listMinutes = 480;
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;
#extraConfig = ''
# proxy_set_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
# proxy_set_header X-Content-Type-Options nosniff;
# proxy_set_header X-Frame-Options DENY;
# proxy_set_header X-XSS-Protection "1; mode=block";
#'';
locations = {
"/" = {
proxyPass = "http://127.0.0.1:${nitter_port}";
};
#"/robots.txt" = {
# #return = ''"User-agent: *\nDisallow: /\n"'';
# extraConfig = "add_header Content-Type text/plain;";
#};
};
};
2022-01-27 17:14:52 +01:00
}
# vim: set et ts=2 sw=2 ai: