1 { pkgs, config, users, lib, ... }:
3 fqdn = "twtxt.${config.networking.fqdn}";
9 environment.systemPackages = [
13 enable = lib.mkDefault true;
14 virtualHosts."${fqdn}" = {
15 root = "/var/lib/twtxt";
16 enableACME = config.security.acme.acceptTerms;
17 forceSSL = config.security.acme.acceptTerms;
20 tryFiles = "/twtxt.txt =404"; # Read that path out loud three times fast.
25 systemd.tmpfiles.rules = lib.mkIf config.services.syncthing.enable [
26 "d '/var/lib/twtxt' 0774 ${config.services.nginx.user} twtxt"
27 "Z '/var/lib/twtxt' 0774 ${config.services.nginx.user} twtxt"