summaryrefslogtreecommitdiff
path: root/common/network.nix
diff options
context:
space:
mode:
authortoufic ar <contact@toufy.me>2026-04-22 14:08:19 +0300
committertoufic ar <contact@toufy.me>2026-04-22 14:08:19 +0300
commitc7349e466fef7ecff5a46b1d0c819975a6bdcb8c (patch)
tree2a3fc53016ae4d0b31d7583171bd4b8e60f4cc17 /common/network.nix
downloadservers-c7349e466fef7ecff5a46b1d0c819975a6bdcb8c.tar.gz
servers-c7349e466fef7ecff5a46b1d0c819975a6bdcb8c.zip
initial commit
Diffstat (limited to 'common/network.nix')
-rw-r--r--common/network.nix19
1 files changed, 19 insertions, 0 deletions
diff --git a/common/network.nix b/common/network.nix
new file mode 100644
index 0000000..c1d6eda
--- /dev/null
+++ b/common/network.nix
@@ -0,0 +1,19 @@
+{config, ...}: let
+ customDomain = config.customOps.domain.fqdn;
+ hostname = config.networking.hostName;
+in {
+ networking = {
+ enableIPv6 = true;
+ firewall = {
+ logRefusedPackets = true;
+ allowedTCPPorts = [80 443];
+ };
+ };
+
+ services.nginx.virtualHosts."${hostname}.${customDomain}" = {
+ default = true;
+ locations."/".return = 204;
+ forceSSL = true;
+ enableACME = true;
+ };
+}