From 347f032f66125b8e9fea7f5f5de0399aceee8fc0 Mon Sep 17 00:00:00 2001 From: Linnnus Date: Wed, 29 Jan 2025 10:51:10 +0100 Subject: 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 --- hosts/ahmed/nginx/default.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 hosts/ahmed/nginx/default.nix (limited to 'hosts/ahmed/nginx/default.nix') 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}-acme@gmail.com"; + }; + + # Allow HTTP connections. + networking.firewall.allowedTCPPorts = [80 443]; +} -- cgit v1.2.3