nixos-config/machines/renge/services/libreddit.nix
2023-05-06 11:39:31 +02:00

22 lines
460 B
Nix

{ config, ... }:
let
cfg = config.services.libreddit;
in
{
services.libreddit = {
enable = true;
address = "127.0.0.1";
};
services.nginx.virtualHosts."libreddit.sbruder.xyz" = {
extraConfig = ''
allow ${config.sbruder.wireguard.home.subnet};
deny all;
'';
locations = {
"/robots.txt".return = "200 'User-agent: *\\nDisallow: /'";
"/".proxyPass = "http://${cfg.address}:${toString cfg.port}";
};
};
}