Summary Files Commits Branches @commit @diff @stats
path: root / machines / marduk / httpd.nix
diff options
context:
space:
mode:
Commit1e99bf8f1c33e77c6aa5a5a4d128b71b4a8e53f1 (patch)
Author
 Syndamia <kamen@syndamia.com>
2025-07-04 09:21:44 +0300
Committer
 Syndamia <kamen@syndamia.com>
2025-07-04 09:21:44 +0300
Files4890638ba55b5d7c4ae05b751fe14c8f0b9b1713 /machines/marduk/httpd.nix
nix-1e99bf8f1c33e77c6aa5a5a4d128b71b4a8e53f1.tar
nix-1e99bf8f1c33e77c6aa5a5a4d128b71b4a8e53f1.tar.gz
nix-1e99bf8f1c33e77c6aa5a5a4d128b71b4a8e53f1.zip
Parent5a7f3676d1dd5c0792a4c1637aca04c3609b3db6 (diff)
feat(machines/marduk): Split configuration into multiple files and make code more generic
1 files changed, 40 insertions, 0 deletions
-rw-r--r--machines/marduk/httpd.nix40
diff --git a/machines/marduk/httpd.nix b/machines/marduk/httpd.nix
new file mode 100644
index 0000000..eb6d8af
--- /dev/null
+++ b/machines/marduk/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>
+ '';
+ };
+ };
+ };
+}