aboutsummaryrefslogtreecommitdiff
path: root/modules/nixos/services/web/stargazers/default.nix
blob: 2a7babed28bd17ef060495b04e934d4e24088b0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{ options, config, lib, namespace, ... }:

with lib; with lib.${namespace}; let
  cfg = config.${namespace}.services.web.stargazers;
  impermanence = config.${namespace}.system.impermanence;
in {
  options.${namespace}.services.web.stargazers = with types; {
    enable = mkEnableOption "stargazers webserver";
  };

  config = mkIf cfg.enable {
    cxl.services.web.enable = true;

    environment.persistence.${impermanence.location} = {
      directories = [
        "/srv/web/stargazers"
      ];
    };
    
    services.nginx = {
      enable = true;
      virtualHosts = {
        "stargazers.xn--6frz82g" = {
          addSSL = true;
          enableACME = true;

          root = "/srv/web/stargazers";
        };
      };
    };
  };
}