aboutsummaryrefslogtreecommitdiff
path: root/nix/per-host/caldav/configuration.nix
blob: 627310a43f843be7d691de9506cfd8599f997239 (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
{ config, pkgs, modulesPath, lib, system, ... }:

{
  config = {
    sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
    sops.defaultSopsFile = ../../secrets/caldav.yaml;
    sops.secrets."radicale/users" = {
      owner = "radicale";
      restartUnits = [ "radicale.service" ];
    };

    networking.hostName = "caldav";
    networking.firewall.allowedTCPPorts = [ 5232 ];

    services.radicale = {
      enable = true;
      settings = {
        server.hosts = [ "0.0.0.0:5232" ];
        auth = {
          type = "htpasswd";
          htpasswd_filename = config.sops.secrets."radicale/users".path;
          htpasswd_encryption = "bcrypt";
        };
      };
    };
  };
}