2021-06-10 20:56:40 +02:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
internalPort = 5232;
|
|
|
|
|
2021-06-10 21:34:27 +02:00
|
|
|
radicaleOverlay = self: super: {
|
2021-06-10 22:46:18 +02:00
|
|
|
#radicaleWithInfcloud = super.radicale.overrideAttrs (old: {
|
|
|
|
# propagatedBuildInputs = old.propagatedBuildInputs ++ [
|
|
|
|
# pkgs.python3Packages.radicale_infcloud
|
|
|
|
# ];
|
|
|
|
#});
|
|
|
|
radicaleWithInfcloud = super.radicale.override {
|
|
|
|
python3 = super.python3.withPackages
|
|
|
|
(packages: with packages; [ bcrypt radicale_infcloud ]);
|
|
|
|
};
|
2021-06-10 20:56:40 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
in {
|
|
|
|
|
|
|
|
nixpkgs.overlays = [ radicaleOverlay ];
|
|
|
|
|
|
|
|
services.radicale = {
|
|
|
|
enable = true;
|
2021-06-10 22:46:18 +02:00
|
|
|
package = pkgs.radicaleWithInfcloud;
|
2021-06-10 20:56:40 +02:00
|
|
|
settings = {
|
2021-06-10 21:34:27 +02:00
|
|
|
server = {
|
2021-06-10 20:56:40 +02:00
|
|
|
hosts = [ "[::1]:${builtins.toString internalPort}" ];
|
|
|
|
max_connections = 8;
|
|
|
|
max_content_length = 100000000;
|
|
|
|
timeout = 30;
|
|
|
|
};
|
|
|
|
auth = {
|
|
|
|
type = "htpasswd";
|
|
|
|
htpasswd_filename = "/etc/radicale/users";
|
|
|
|
htpasswd_encryption = "bcrypt";
|
|
|
|
delay = 1;
|
|
|
|
};
|
|
|
|
encoding = {
|
|
|
|
request = "utf-8";
|
|
|
|
stock = "utf-8";
|
|
|
|
};
|
2021-06-10 21:34:27 +02:00
|
|
|
storage = { filesystem_folder = "/var/lib/radicale/collections"; };
|
2021-06-10 22:15:14 +02:00
|
|
|
web = { type = "radicale_infcloud"; };
|
2021-06-10 21:34:27 +02:00
|
|
|
logging = { mask_passwords = true; };
|
2021-06-10 20:56:40 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-06-10 22:15:14 +02:00
|
|
|
services.nginx.virtualHosts."cal.tammena.rocks" = {
|
2021-06-10 20:56:40 +02:00
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
|
|
|
locations."/" = {
|
2021-06-10 21:45:05 +02:00
|
|
|
proxyPass = "http://[::1]:${builtins.toString internalPort}";
|
2021-06-10 20:56:40 +02:00
|
|
|
#proxyWebsockets = true; # needed if you need to use WebSocket
|
|
|
|
#extraConfig =
|
2021-06-10 21:34:27 +02:00
|
|
|
# required when the target is also TLS server with multiple hosts
|
|
|
|
#"proxy_ssl_server_name on;" +
|
|
|
|
# required when the server wants to use HTTP Authentication
|
|
|
|
#"proxy_pass_header Authorization;";
|
2021-06-10 20:56:40 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|