{ config, lib, pkgs, ... }: with lib; let cfg = config.local.dav; in { options.local.dav = with types; { enable = mkEnableOption "Web/Card/CalDAV"; }; config = mkIf cfg.enable { systemd.user = { services.xandikos = { Unit = { Description = "Xandikos CalDAV/CardDAV server"; }; Service = { ExecStart = escapeShellArgs [ (getExe pkgs.xandikos) "-d" "${config.home.homeDirectory}/dav" "--route-prefix" "/${config.home.username}/dav" "--current-user-principal" "/user/" # Hacerlo fallar si no agarra systemd socket activation por cualquier motivo "-p" "1" ]; Type = "simple"; }; }; sockets.xandikos = { Unit = { Description = "Xandikos socket"; }; Socket = { ListenStream = "/run/host-www/ale/dav.sock"; }; Install = { WantedBy = ["sockets.target"]; }; }; }; }; }