]> Untitled Git - awful.systems.git/blob - maint-mode/default.nix
docs: add database information
[awful.systems.git] / maint-mode / default.nix
1 { config, lib, pkgs, ... }:
2
3 with lib;
4 let cfg = config.awful.systems.maint-mode;
5 in {
6   options.awful.systems.maint-mode = {
7     enable = mkEnableOption (mdDoc ''
8       Whether to configure nginx to display the maintenance mode route as default.
9     '');
10     virtualHost = mkOption {
11       type = types.str;
12       description = lib.mdDoc
13         "The nginx virtualHost to show the maintenance mode route for.";
14     };
15   };
16
17   config = mkIf cfg.enable {
18     services.nginx = {
19       enable = true;
20       virtualHosts."${cfg.virtualHost}" = {
21         root = mkForce (pkgs.callPackage ./site.nix { });
22       };
23     };
24
25     networking.firewall.allowedTCPPorts = [ 80 ];
26   };
27 }