2016-06-18 07:18:36 +00:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
let
|
|
|
|
radicalePort = 8002;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
services.radicale = {
|
|
|
|
enable = true;
|
2019-08-26 16:06:21 +00:00
|
|
|
package = pkgs.radicale2;
|
2021-06-27 12:40:28 +00:00
|
|
|
settings = {
|
|
|
|
server = {
|
|
|
|
hosts = "127.0.0.1:${toString radicalePort}";
|
|
|
|
ssl = false;
|
|
|
|
dns_lookup = false;
|
|
|
|
};
|
2016-06-18 07:18:36 +00:00
|
|
|
|
2021-06-27 12:40:28 +00:00
|
|
|
storage = {
|
|
|
|
filesystem_folder = "/var/lib/radicale/collections";
|
|
|
|
};
|
2016-06-18 07:18:36 +00:00
|
|
|
|
2021-06-27 12:40:28 +00:00
|
|
|
auth = {
|
|
|
|
type = "htpasswd";
|
|
|
|
htpasswd_filename = "/var/lib/radicale/htpasswd";
|
|
|
|
};
|
2016-06-18 07:18:36 +00:00
|
|
|
|
2021-06-27 12:40:28 +00:00
|
|
|
rights = {
|
|
|
|
type = "owner_only";
|
|
|
|
};
|
|
|
|
};
|
2016-06-18 07:18:36 +00:00
|
|
|
};
|
|
|
|
|
2020-10-30 18:06:17 +00:00
|
|
|
security.acme.certs."gebner.org".extraDomainNames = [ "radicale.gebner.org" ];
|
2016-06-18 07:18:36 +00:00
|
|
|
|
2019-08-25 16:04:33 +00:00
|
|
|
services.nginx = {
|
|
|
|
recommendedProxySettings = true;
|
|
|
|
virtualHosts."radicale.gebner.org" = {
|
|
|
|
forceSSL = true;
|
|
|
|
useACMEHost = "gebner.org";
|
|
|
|
locations."/" = {
|
|
|
|
proxyPass = "http://127.0.0.1:${toString radicalePort}";
|
|
|
|
};
|
2021-07-14 12:10:24 +00:00
|
|
|
# Fake nextcloud api:
|
|
|
|
# https://gitlab.gnome.org/GNOME/gnome-online-accounts/-/issues/1#note_857357
|
|
|
|
extraConfig = ''
|
|
|
|
rewrite ^/remote.php/carddav / redirect;
|
|
|
|
rewrite ^/remote.php/caldav / redirect;
|
|
|
|
|
|
|
|
location /remote.php/webdav {
|
|
|
|
return 200;
|
|
|
|
}
|
|
|
|
'';
|
2019-08-25 16:04:33 +00:00
|
|
|
};
|
|
|
|
};
|
2016-06-18 07:18:36 +00:00
|
|
|
|
2019-08-26 16:06:21 +00:00
|
|
|
environment.systemPackages = with pkgs; [ apacheHttpd ];
|
|
|
|
|
2016-06-18 07:18:36 +00:00
|
|
|
}
|