all repos — nixfiles @ 4b8a6dbe53b4635a332ea98f9b97ac82bc473fa1

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

system/roles/push-notifications.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
{
  config,
  ...
}:
{
  services.ntfy-sh = {
    enable = true;
    settings = {
      base-url = "https://ntfy.alin.ovh";
      behind-proxy = true;
      upstream-base-url = "https://ntfy.sh";
      auth-default-access = "deny";
      enable-login = true;
      require-login = true;
    };
  };

  services.caddy.virtualHosts = {
    "ntfy.${config.networking.domain}" = {
      extraConfig = ''
        reverse_proxy ${config.services.ntfy-sh.settings.listen-http}
      '';
    };
  };
}