summaryrefslogtreecommitdiff
path: root/hosts/ahmed/nginx/default.nix
diff options
context:
space:
mode:
authorLinnnus <[email protected]>2025-01-29 10:51:10 +0100
committerLinnnus <[email protected]>2025-01-29 10:59:01 +0100
commit347f032f66125b8e9fea7f5f5de0399aceee8fc0 (patch)
treed191e8aa6561633ae6a0593ebbf69761fa42a357 /hosts/ahmed/nginx/default.nix
parent827c6802fc8947ca063d969f6356be75f28e1040 (diff)
ahmed: Factor configuration.nix into smaller submodules
I checked that this didn't result in any (non-trivial) changes like so: $ vi hosts/ahmed/configuration.nix $ nixos-rebuild build --flake .#ahmed $ nix-diff /run/current-system ./result
Diffstat (limited to 'hosts/ahmed/nginx/default.nix')
-rw-r--r--hosts/ahmed/nginx/default.nix18
1 files changed, 18 insertions, 0 deletions
diff --git a/hosts/ahmed/nginx/default.nix b/hosts/ahmed/nginx/default.nix
new file mode 100644
index 0000000..24dde85
--- /dev/null
+++ b/hosts/ahmed/nginx/default.nix
@@ -0,0 +1,18 @@
+# This module sets up an NGINX on this host.
+#
+# Different services' will register themselves with NGINX via
+# `services.nginx.virtualHosts`. They may also want to order themselves before
+# NGINX `systemd.services.*.{before,wantedBy}`.
+{config, ...}: {
+ # Virtual hosts.
+ services.nginx.enable = true;
+
+ # Configure ACME. This is used by various HTTP services through the NGINX virtual hosts.
+ security.acme = {
+ acceptTerms = true;
+ defaults.email = "linusvejlo+${config.networking.hostName}[email protected]";
+ };
+
+ # Allow HTTP connections.
+ networking.firewall.allowedTCPPorts = [80 443];
+}