about summary refs log tree commit diff
path: root/pkgs/openlab
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2016-08-27 02:07:50 +0200
committerProfpatsch <mail@profpatsch.de>2016-08-27 02:09:11 +0200
commit4c3dbd23caf224b92cf5ccf2665d525707627024 (patch)
tree1c8c6e5ca8a0425266b83cbfad5f73ad4aee9550 /pkgs/openlab
parentb387b29d68cf20142b7f4432173ee45770484453 (diff)
pkgs/openlab/stackenblocken: init
A script that executes a nice STACKENBLOCKEN into the air.
Diffstat (limited to 'pkgs/openlab')
-rw-r--r--pkgs/openlab/stackenblocken/default.nix35
1 files changed, 35 insertions, 0 deletions
diff --git a/pkgs/openlab/stackenblocken/default.nix b/pkgs/openlab/stackenblocken/default.nix
new file mode 100644
index 00000000..150b6afa
--- /dev/null
+++ b/pkgs/openlab/stackenblocken/default.nix
@@ -0,0 +1,35 @@
+{ lib, fetchFromGitHub, writeScriptBin
+, haskellPackages, mpg321 }:
+
+let
+  repo = fetchFromGitHub {
+    owner = "openlab-aux";
+    repo = "stackenblocken";
+    rev = "labpingbot";
+    sha256 = "1x319sbkk8hl3lad2zapkdv6ihqqsl8f5l0a2n9fvppcm5c7pz0d";
+ };
+
+ bot = haskellPackages.callPackage "${repo}/stackenblocken.nix" {};
+ jingle = "${repo}/stackenblocken_jingle.mp3";
+
+ script = ''
+   #!/bin/sh
+
+   # kill everything on SIGINT
+   trap exit SIGINT
+   # also running background processes
+   trap "kill 0" EXIT
+
+   for i in $(seq 2); do
+     echo "starting .labping bot"
+     ${lib.getBin bot}/bin/stackenblocken &
+
+     echo "DOING STACKENBLOCKEN"
+     ${lib.getBin mpg321}/bin/mpg321 -q ${jingle}
+   done
+ '';
+
+
+in
+  writeScriptBin "stackenblocken" script
+