citadel

My dotfiles, scripts and nix configs
git clone git://jb55.com/citadel
Log | Files | Refs | README | LICENSE

default.nix (1435B)


      1 extra:
      2 { config, lib, pkgs, ... }:
      3 let
      4   util = extra.util;
      5 in
      6 {
      7 
      8   systemd.user.services.cookie-bot = {
      9     description = "copy cookies to archer";
     10 
     11     wantedBy = [ "default.target" ];
     12     after    = [ "default.target" ];
     13 
     14     path = with pkgs; [ openssh rsync ];
     15 
     16     serviceConfig.ExecStart = util.writeBash "cp-cookies" ''
     17       export HOME=/home/jb55
     18       PTH=".config/chromium/Default/Cookies"
     19       rsync -av $HOME/$PTH archer:$PTH
     20     '';
     21     unitConfig.OnFailure = "notify-failed-user@%n.service";
     22 
     23     startAt = [
     24       "*-*-20 09:24:00"       # youtube bot is run on the 20th at 10:24:00
     25       "Tue *-*-1..7 15:00:00" # cookies for itunes bot on the first tuesday
     26     ];
     27   };
     28 
     29   systemd.user.services.cookie-bot-reminder = {
     30     description = "reminder to login";
     31 
     32     wantedBy = [ "default.target" ];
     33     after    = [ "default.target" ];
     34 
     35     serviceConfig.ExecStart = util.writeBash "cookie-reminder" ''
     36       /run/wrappers/bin/sendmail -f bill@monstercat.com <<EOF
     37       To: bill@monstercat.com
     38       Cc: jb55@jb55.com
     39       From: THE COOKIE MONSTER <cookiemonster@quiver>
     40       Subject: Reminder to log into YouTube cms
     41 
     42       I'll be doing an rsync from quiver tomorrow at 10:24
     43 
     44       Here's a link for your convenience:
     45 
     46         https://cms.youtube.com
     47 
     48       Cheers,
     49         THE COOKIE MONSTER
     50       EOF
     51     '';
     52     unitConfig.OnFailure = "notify-failed-user@%n.service";
     53 
     54     startAt = "*-*-19 10:24:00";
     55   };
     56 
     57 }