all repos — nixfiles @ f01eda735de337e88df339eb6cf772c618ec84df

System and user configuration, managed by nix and home-manager

system/roles/calendar-anonymiser.nix (view raw)

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
33
34
35
36
37
{
  inputs,
  config,
  ...
}:
let
  email = "alan@alanpearce.eu";
  srv = config.services.mycal;
in
{
  imports = [
    inputs.mycal.nixosModules.mycal
    ../../private/calendar.nix
  ];
  services.mycal = {
    enable = true;
    port = 8002;

    settings = {
      timezone = config.time.timeZone;
      name = "Alin";
      inherit email;
    };
  };

  services.caddy.virtualHosts = {
    "cal.${config.networking.domain}" = {
      extraConfig = ''
        encode zstd gzip
        cache {
          ttl 15m
        }
        reverse_proxy ${srv.host}:${toString srv.port}
      '';
    };
  };
}