aboutsummaryrefslogtreecommitdiff
path: root/modules/nixos/services/web/cxl.sh/default.nix
blob: 86b35d1f6999b4acc030c02c0afbbd04bb474190 (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.cxl.sh;
  impermanence = config.${namespace}.system.impermanence;
in {
  options.${namespace}.services.web.cxl.sh = with types; {
    enable = mkEnableOption "cxl.sh webserver";
  };

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

    environment.persistence.${impermanence.location} = {
      directories = [
        "/srv/web/cxl.sh"
      ];
    };
    
    services.nginx = {
      enable = true;
      virtualHosts = {
        "cxl.sh" = {
          addSSL = true;
          enableACME = true;

          root = "/srv/web/cxl.sh";
        };
      };
    };
  };
}