22 lines
460 B
Nix
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}";
|
|
};
|
|
};
|
|
}
|