From 2a22d5c54f923ece8247dd4095afeea3ed7cf7d4 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Wed, 28 Mar 2018 07:33:39 +0200 Subject: machines/katara: add user services for pyrnotify --- machines/profpatsch/katara.nix | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'machines/profpatsch/katara.nix') diff --git a/machines/profpatsch/katara.nix b/machines/profpatsch/katara.nix index 2e480da9..68e91981 100644 --- a/machines/profpatsch/katara.nix +++ b/machines/profpatsch/katara.nix @@ -400,6 +400,36 @@ in { }; } + ({ + services.pyrnotify-ssh-connection = { + description = "ssh connection to make pyrnotify work"; + serviceConfig = { + Environment = ''"SSH_AUTH_SOCK=%t/gnupg/S.gpg-agent.ssh"''; + # forwards the remote socket over ssh, restarts every 5 minutes + ExecStart = pkgs.writeScript "pyrnotify-start-ssh" '' + #!${pkgs.stdenv.shell} + ${lib.getBin pkgs.openssh}/bin/ssh \ + bigmac \ + "rm /home/bigmac/.weechat/pyrnotify.socket" + ${lib.getBin pkgs.openssh}/bin/ssh \ + -R /home/bigmac/.weechat/pyrnotify.socket:localhost:8099 \ + bigmac \ + "sleep 300" + ''; + Restart = "on-failure"; + }; + }; + services.pyrnotify-listen = rec { + description = "get notified about weechat messages"; + serviceConfig = { + ExecStart = "${lib.getBin pkgs.python + }/bin/python ${myPkgs.pyrnotify} 8099"; + }; + requires = [ "pyrnotify-ssh-connection.service" ]; + after = requires; + }; + }) + ]; }; -- cgit 1.4.1