This commit is contained in:
root 2025-11-02 14:05:51 +00:00
commit d4bea4c7c5
12 changed files with 328 additions and 0 deletions

32
services/site.nix Normal file
View file

@ -0,0 +1,32 @@
{
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;};
}
];
}