diff options
| author | Alejandro Soto <alejandro@34project.org> | 2025-04-17 17:18:19 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2025-04-19 11:10:00 -0600 |
| commit | c85e8fe37d06358b06674020899e920f5fb1818b (patch) | |
| tree | 8d60c30e9e9f909e74397bb68af73b3858d503f6 /home/pim/dav.nix | |
| parent | 686e6e85e83770dc3ab18613ad5dad50ed59dda8 (diff) | |
home/pim: enable Xandikos DAV server
Diffstat (limited to 'home/pim/dav.nix')
| -rw-r--r-- | home/pim/dav.nix | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/home/pim/dav.nix b/home/pim/dav.nix new file mode 100644 index 0000000..c19b2ed --- /dev/null +++ b/home/pim/dav.nix @@ -0,0 +1,50 @@ +{ 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" ]; + }; + }; + }; + }; +} |
