commit ae604b2d25f840e906a624108b8efc561bed61e2 parent 61bdd71e2762d9c249647646099636d814b7cf7e Author: William Casarin <jb55@jb55.com> Date: Mon, 21 Jun 2021 16:25:56 -0700 bitcoin-contacts service Signed-off-by: William Casarin <jb55@jb55.com> Diffstat:
M | nix-config/machines/monad/default.nix | | | 28 | ++++++++++++++++++++++++++++ |
1 file changed, 28 insertions(+), 0 deletions(-)
diff --git a/nix-config/machines/monad/default.nix b/nix-config/machines/monad/default.nix @@ -8,6 +8,8 @@ let util = extra.util; rev = "0bc27f4740e382f2a2896dc1dabfec1d0ac96818"; sha256 = "1h1h2n50d2cwcyw3zp4lamfvrdjy1gjghffvl3qrp6arfsfa615y"; }; + jb55pkgs = import <jb55pkgs> { inherit pkgs; }; + git-email-contacts = "${jb55pkgs.git-email-contacts}/bin/git-email-contacts"; email-notify = util.writeBash "email-notify-user" '' export HOME=/home/jb55 export PATH=${lib.makeBinPath (with pkgs; [ eject libnotify muchsync notmuch openssh ])}:$PATH @@ -162,6 +164,32 @@ in startAt = "Mon..Fri *-*-* 09:00:00"; }; + systemd.user.services.bitcoin-contacts = { + enable = if extra.is-minimal then false else true; + description = "Email bitcoin PR patches that have me as a git-contact"; + + wantedBy = [ "graphical-session.target" ]; + after = [ "graphical-session.target" ]; + + path = with pkgs; [ openssh msmtp libnotify netcat ]; + + environment = { + SSH_AUTH_SOCK = "/run/user/1000/ssh-agent"; + }; + + serviceConfig.ExecStart = util.writeBash "bitcoin-contacts" '' + export SSH_ASKPASS="${pkgs.x11_ssh_askpass}/libexec/x11-ssh-askpass" + cd /home/jb55/dev/github/bitcoin/bitcoin + while true + do + duration="5m" + ${git-email-contacts} + printf "done for now, waiting %s...\n" $duration 2>&1 + sleep $duration + done + ''; + }; + systemd.user.services.stop-spotify-bedtime = { enable = if extra.is-minimal then false else true; description = "Stop spotify when Elliott goes to bed";