nixos-dots

nixos dots
git clone git://popovic.xyz/nixos-dots.git
Log | Files | Refs

mbsync_timer.nix (1250B)


      1 { pkgs, ... }:
      2 {
      3   systemd.user = {
      4     startServices = "sd-switch";
      5     services.mbsync = {
      6       Unit = {
      7         Description = "Mailbox sync service";
      8         RefuseManualStart = "no";
      9         RefuseManualStop = "yes";
     10       };
     11       Service = {
     12         Type = "oneshot";
     13         ExecStart = "${pkgs.zsh}/bin/zsh -c 'mbsync -c .config/isync/mbsyncrc -a -q'";
     14       };
     15       Install = {
     16         wantedBy = [ "default.target" ];
     17       };
     18     };
     19     timers.mbsync = {
     20       Unit = {
     21         Description = "Mailbox sync timer";
     22         RefuseManualStop = "no";
     23         RefuseManualStart = "no";
     24       };
     25       Timer = {
     26         Persistent = false;
     27         OnBootSec = "0.3m";
     28         OnUnitActiveSec = "0.5m";
     29         Unit = "mbsync.service";
     30       };
     31       Install = {
     32         WantedBy = [ "timers.target" ];
     33       };
     34     };
     35     services.monitor-wakeup = {
     36       Unit = {
     37         Description = "Wake up external monitors after sleep/hiberanate";
     38         RefuseManualStart = "no";
     39         RefuseManualStop = "yes";
     40       };
     41       Service = {
     42         Type = "oneshot";
     43         ExecStart = "${pkgs.zsh}/bin/zsh -c 'zsh .local/bin/scripts/niri-wakeup-monitors'";
     44       };
     45       Install = {
     46         wantedBy = [ "default.target" ];
     47       };
     48     };
     49   };
     50 }