{ inputs, config, lib, ... }: with lib; let cfg = config.modules.services.sefidel-web; in { options.modules.services.sefidel-web = { enable = mkEnableOption "sefidel-web"; }; config = mkIf cfg.enable { services.nginx.virtualHosts."sefidel.net" = { useACMEHost = "sefidel.net"; forceSSL = true; # TODO: causes css to be fetched every single time. # This is because heuristic caching is disabled, since Nix removes the last-modified timestamp. root = inputs.sefidel-web.defaultPackage.${config.nixpkgs.system}; # Fixes the problem above. locations."~ \\.(js|css|woff|woff2?|png|jpe?g|svg)$".extraConfig = '' add_header Cache-Control "public, max-age=14400, must-revalidate"; ''; }; }; }