From fa3351f0099096419ef72d4fbc71b32c178396bc Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sat, 5 Jan 2019 17:24:38 +0000 Subject: Add config --- modules/workstation/mail/isync/default.nix | 36 ++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 modules/workstation/mail/isync/default.nix (limited to 'modules/workstation/mail/isync') diff --git a/modules/workstation/mail/isync/default.nix b/modules/workstation/mail/isync/default.nix new file mode 100644 index 000000000000..66343a0c3625 --- /dev/null +++ b/modules/workstation/mail/isync/default.nix @@ -0,0 +1,36 @@ +{ pkgs, options, ... }: + +let + inherit (pkgs.pkgsConfigured) isync; + +in { + config = + if options.environment ? "darwinConfig" then + { + launchd.user.agents.isync = { + serviceConfig.ProgramArguments = [ "${isync}/bin/mbsync" "Periodic" ]; + serviceConfig.StartInterval = 300; + serviceConfig.RunAtLoad = true; + }; + } + else + { + systemd.user.services.isync = { + serviceConfig = { + Type = "oneshot"; + ExecStart = '' + ${isync}/bin/mbsync Periodic + ''; + }; + }; + + systemd.user.timers.isync = { + timerConfig = { + Unit = "isync.service"; + OnCalendar = "*:0/5"; + Persistent = "true"; + }; + wantedBy = [ "default.target" ]; + }; + }; +} -- cgit 1.4.1