grace/dots
dotfiles/nix configs
git clone https://git.gae.moe/grace/dots
b70d9f9
main
1{ lib , pkgs , ...} : 2 3let 4# TODO: make an actual offline page. 5offlinePage = pkgs . writeTextDir "offline.html" '' 6<!doctype html> 7<html lang="en"><head><title>Service temporarily offline</title></head> 8<body><h1>Page Down</h1><p>The backend server is offline. Please check again later.</p></body></html> 9'' ; 10in 11{ 12options . services . nginx . virtualHosts = lib . mkOption { 13type = lib . types . attrsOf ( 14lib . types . submodule { 15config = { 16enableACME = lib . mkDefault true ; 17forceSSL = lib . mkDefault true ; 18extraConfig = '' 19error_page 502 503 504 /_offline.html; 20proxy_intercept_errors on; 21'' ; 22locations . "= /_offline.html" = { 23root = offlinePage ; 24extraConfig = '' 25internal; 26auth_request off; 27rewrite ^ /offline.html break; 28add_header Cache-Control "no-store" always; 29'' ; 30}; 31}; 32} 33); 34}; 35}