32 lines
738 B
Nix
32 lines
738 B
Nix
{
|
|
pkgs,
|
|
lib,
|
|
...
|
|
}: let
|
|
sitePort = 8080;
|
|
in {
|
|
systemd.services.python-http-server = {
|
|
description = "Simple Python HTTP Server";
|
|
after = ["network.target"];
|
|
wantedBy = ["multi-user.target"];
|
|
serviceConfig = {
|
|
ExecStart = "${pkgs.python3}/bin/python3 -m http.server ${toString sitePort} --directory /var/www/distrust.network";
|
|
Restart = "on-failure";
|
|
User = "nobody";
|
|
WorkingDirectory = "/var/www/distrust.network";
|
|
};
|
|
};
|
|
|
|
services.caddy.virtualHosts."distrust.network" = {
|
|
extraConfig = ''
|
|
reverse_proxy localhost:${toString sitePort}
|
|
'';
|
|
};
|
|
|
|
services.tor.relay.onionServices."site".map = [
|
|
{
|
|
port = 80;
|
|
target = {port = sitePort;};
|
|
}
|
|
];
|
|
}
|