From 58b36434491e9b9801b689bad924b87dec8119cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Eug=C3=AAnio?= Date: Sat, 18 Feb 2023 12:15:05 -0300 Subject: [PATCH] vidr: fix syncing --- user/vdir.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/user/vdir.nix b/user/vdir.nix index 7187f02..ab5d2de 100644 --- a/user/vdir.nix +++ b/user/vdir.nix @@ -7,22 +7,22 @@ let in { systemd.user.services.vdirsyncer = { - Unit = { - Description = "vdirsyncer calendar and contacts synchronization"; - }; + Unit.Description = "vdirsyncer calendar and contacts synchronization"; Service = { Type = "oneshot"; - ExecStartPre = "yes | ${pkgs.vdirsyncer}/bin/vdirsyncer discover"; - ExecStart = "${pkgs.vdirsyncer}/bin/vdirsyncer sync"; + ExecStart = toString (pkgs.writeShellScript "run-vdirsyncer" '' + ${pkgs.coreutils}/bin/yes | ${pkgs.vdirsyncer}/bin/vdirsyncer discover + ${pkgs.coreutils}/bin/yes | ${pkgs.vdirsyncer}/bin/vdirsyncer sync + ''); }; }; systemd.user.timers.vdirsyncer = { - Unit = { Description = "vdirsyncer calendar and contacts synchronization"; }; + Unit.Description = "vdirsyncer calendar and contacts synchronization"; Timer = { OnCalendar = "*:0/30"; Unit = "vdirsyncer.service"; }; - Install = { WantedBy = [ "timers.target" ]; }; + Install.WantedBy = [ "timers.target" ]; }; xdg.configFile = {