diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-01-05 17:24:38 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-01-27 15:08:16 +0000 |
commit | fa3351f0099096419ef72d4fbc71b32c178396bc (patch) | |
tree | b2200d2a29ebe7806f6a2fe218caf52010ca519d /modules/workstation/mail/isync | |
parent | f0a202366786b44ffd486c588d9150d1fb5ecea3 (diff) | |
download | nixlib-fa3351f0099096419ef72d4fbc71b32c178396bc.tar nixlib-fa3351f0099096419ef72d4fbc71b32c178396bc.tar.gz nixlib-fa3351f0099096419ef72d4fbc71b32c178396bc.tar.bz2 nixlib-fa3351f0099096419ef72d4fbc71b32c178396bc.tar.lz nixlib-fa3351f0099096419ef72d4fbc71b32c178396bc.tar.xz nixlib-fa3351f0099096419ef72d4fbc71b32c178396bc.tar.zst nixlib-fa3351f0099096419ef72d4fbc71b32c178396bc.zip |
Add config
Diffstat (limited to 'modules/workstation/mail/isync')
-rw-r--r-- | modules/workstation/mail/isync/default.nix | 36 |
1 files changed, 36 insertions, 0 deletions
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" ]; + }; + }; +} |