1
0
Fork 0

Add vdir watching

This commit is contained in:
Malte Brandy 2021-07-14 18:31:53 +02:00
parent 0fffe4686c
commit e4dd6655a5
No known key found for this signature in database
GPG key ID: 226A2D41EF5378C9

View file

@ -1,4 +1,4 @@
{ pkgs, lib, ... }:
{ pkgs, lib, config, ... }:
let
addressbooks = pkgs.privateValue [ ] "addressbooks";
calendars = pkgs.privateValue [ ] "calendars";
@ -79,6 +79,19 @@ in
home.packages = [ pkgs.vdirsyncer ];
systemd.user = {
services.entr-watch-vdir = {
Unit.Description = "Watch vdir data for changes";
Service = {
ExecStart = toString (
pkgs.writeShellScript "entr-watch-vdir" ''
while sleep 1s; do
${pkgs.fd}/bin/fd . ${config.home.homeDirectory}/.contacts ${config.home.homeDirectory}/.calendars | ${pkgs.entr}/bin/entr -n -d ${pkgs.vdirsyncer}/bin/vdirsyncer sync
done
''
);
};
Install.WantedBy = [ "default.target" ];
};
services.vdirsyncer = {
Unit.Description = "vdirsyncer sync";
Service = {