diff options
1 files changed, 40 insertions, 0 deletions
| -rw-r--r-- | machines/uttu/httpd.nix | 40 |
diff --git a/machines/uttu/httpd.nix b/machines/uttu/httpd.nix new file mode 100644 index 0000000..eb6d8af --- /dev/null +++ b/machines/uttu/httpd.nix @@ -0,0 +1,40 @@ +{ config, ... }: let + inherit (config.constants) ip tld; +in { + services.dnsmasq.settings.address = [ + "/server.${tld}/ftp.${tld}/samba.${tld}/${ip}" + ]; + + services.httpd = { + virtualHosts = { + "server.${tld}" = { + listen = [ { port = 80; } ]; + documentRoot = "/var/www/server"; + locations."/server-status".extraConfig = '' + SetHandler server-status + ''; + }; + + #== File servers ==# + + "samba.${tld}" = rec { + listen = [ { port = 80; } ]; + documentRoot = "/NetworkDirectory"; + extraConfig = '' + <Directory "${documentRoot}"> + IndexOptions +NameWidth=* +Charset=UTF-8 + </Directory> + ''; + }; + "ftp.${tld}" = rec { + listen = [ { port = 80; } ]; + documentRoot = "/home/ftp"; + extraConfig = '' + <Directory "${documentRoot}"> + IndexOptions +NameWidth=* +Charset=UTF-8 + </Directory> + ''; + }; + }; + }; +} |
