From 8462db2612364ddc6479621dd0d9207376c33cdd Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 26 Jun 2018 22:32:42 +0200 Subject: thesauron -> cholerab --- krebs/5pkgs/simple/cholerab/default.nix | 7 +++++++ krebs/5pkgs/simple/thesauron/default.nix | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 krebs/5pkgs/simple/cholerab/default.nix delete mode 100644 krebs/5pkgs/simple/thesauron/default.nix (limited to 'krebs/5pkgs') diff --git a/krebs/5pkgs/simple/cholerab/default.nix b/krebs/5pkgs/simple/cholerab/default.nix new file mode 100644 index 000000000..9e60898a3 --- /dev/null +++ b/krebs/5pkgs/simple/cholerab/default.nix @@ -0,0 +1,7 @@ +{ fetchgit, callPackage }: let + src = fetchgit { + url = "https://github.com/krebs/cholerab"; + rev = "8ac22588cf2c20465e3c9348e7ce04885599c2a5"; + "sha256"= "1ivkjl235dnm5aaqqvarnxkz7zh0gvah22b0fqwlsflrcd5wmgva"; + }; +in callPackage src {} diff --git a/krebs/5pkgs/simple/thesauron/default.nix b/krebs/5pkgs/simple/thesauron/default.nix deleted file mode 100644 index d543319f2..000000000 --- a/krebs/5pkgs/simple/thesauron/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ fetchgit, callPackage }: let - src = fetchgit { - url = "https://github.com/krebs/thesauron"; - rev = "8ac22588cf2c20465e3c9348e7ce04885599c2a5"; - "sha256"= "1ivkjl235dnm5aaqqvarnxkz7zh0gvah22b0fqwlsflrcd5wmgva"; - }; -in callPackage src {} -- cgit v1.2.3 From d87e52d7cd10fc042d104fc8a77552896d865ee4 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 27 Jun 2018 16:14:16 +0200 Subject: cholerab: 8ac2258 -> 4031072 --- krebs/5pkgs/simple/cholerab/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'krebs/5pkgs') diff --git a/krebs/5pkgs/simple/cholerab/default.nix b/krebs/5pkgs/simple/cholerab/default.nix index 9e60898a3..c9ea8faef 100644 --- a/krebs/5pkgs/simple/cholerab/default.nix +++ b/krebs/5pkgs/simple/cholerab/default.nix @@ -1,7 +1,7 @@ { fetchgit, callPackage }: let src = fetchgit { url = "https://github.com/krebs/cholerab"; - rev = "8ac22588cf2c20465e3c9348e7ce04885599c2a5"; - "sha256"= "1ivkjl235dnm5aaqqvarnxkz7zh0gvah22b0fqwlsflrcd5wmgva"; + rev = "403107219ba9f3b6881f2cdae57ac373a13d98f0"; + sha256 = "076giaha52zxkvkr2f471g2rl9c5m8r5g03wncgh46qmdfcb5idb"; }; in callPackage src {} -- cgit v1.2.3 From 625aee57e71d97f6aa2fe6c02929482698307351 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 27 Jun 2018 23:37:46 +0200 Subject: l ftb: mesa -> mesa_glu --- krebs/5pkgs/simple/ftb/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'krebs/5pkgs') diff --git a/krebs/5pkgs/simple/ftb/default.nix b/krebs/5pkgs/simple/ftb/default.nix index c2e83c9f4..ab7d6e651 100644 --- a/krebs/5pkgs/simple/ftb/default.nix +++ b/krebs/5pkgs/simple/ftb/default.nix @@ -1,7 +1,7 @@ { stdenv, fetchurl , jre, libX11, libXext, libXcursor, libXrandr, libXxf86vm , openjdk -, mesa, openal +, mesa_glu, openal , useAlsa ? false, alsaOss ? null }: with stdenv.lib; @@ -26,7 +26,7 @@ stdenv.mkDerivation { #!${stdenv.shell} export _JAVA_AWT_WM_NONREPARENTING=1 - export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${makeLibraryPath [ libX11 libXext libXcursor libXrandr libXxf86vm mesa openal ]} + export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${makeLibraryPath [ libX11 libXext libXcursor libXrandr libXxf86vm mesa_glu openal ]} ${if useAlsa then "${alsaOss}/bin/aoss" else "" } \ ${jre}/bin/java -jar $out/ftb.jar EOF -- cgit v1.2.3 From a098e2ad4a0b39c9046c9c42282ddeb2bffd6d9d Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 28 Jun 2018 14:10:54 +0200 Subject: cholerab: 4031072 -> 25d7ef05 --- krebs/5pkgs/simple/cholerab/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'krebs/5pkgs') diff --git a/krebs/5pkgs/simple/cholerab/default.nix b/krebs/5pkgs/simple/cholerab/default.nix index c9ea8faef..94514fe44 100644 --- a/krebs/5pkgs/simple/cholerab/default.nix +++ b/krebs/5pkgs/simple/cholerab/default.nix @@ -1,7 +1,7 @@ { fetchgit, callPackage }: let src = fetchgit { url = "https://github.com/krebs/cholerab"; - rev = "403107219ba9f3b6881f2cdae57ac373a13d98f0"; - sha256 = "076giaha52zxkvkr2f471g2rl9c5m8r5g03wncgh46qmdfcb5idb"; + rev = "25d7ef051d6fc74d99b155e768b3c650296a230c"; + sha256 = "1pymw7v2ql42iq825ccx98s4fp9jsz5b2hjr1qad6bamfc6i7yy9"; }; in callPackage src {} -- cgit v1.2.3 From 8cde86561a54652541d9a6c90109d5aa438c21f5 Mon Sep 17 00:00:00 2001 From: jeschli Date: Tue, 3 Jul 2018 20:34:29 +0200 Subject: Reaktor plugins: +taskwarrior --- krebs/5pkgs/simple/Reaktor/plugins.nix | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'krebs/5pkgs') diff --git a/krebs/5pkgs/simple/Reaktor/plugins.nix b/krebs/5pkgs/simple/Reaktor/plugins.nix index c39e39799..4016b6a16 100644 --- a/krebs/5pkgs/simple/Reaktor/plugins.nix +++ b/krebs/5pkgs/simple/Reaktor/plugins.nix @@ -141,6 +141,13 @@ rec { ''; }); + taskwarrior = buildSimpleReaktorPlugin "task" { + pattern = "^task: (?P.*)$$"; + script = pkgs.writeDash "task-wrapper" '' + task "$*" + ''; + }; + todo = name: { add = buildSimpleReaktorPlugin "${name}-add" { pattern = "^${name}-add: (?P.*)$$"; -- cgit v1.2.3 From 70e8c4b0a4255a989bf93fe6fca96244ee617eee Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 3 Jul 2018 21:35:43 +0200 Subject: Reaktor taskwarrior: fix path to taskwarrior --- krebs/5pkgs/simple/Reaktor/plugins.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'krebs/5pkgs') diff --git a/krebs/5pkgs/simple/Reaktor/plugins.nix b/krebs/5pkgs/simple/Reaktor/plugins.nix index 418a3c73c..cd389366e 100644 --- a/krebs/5pkgs/simple/Reaktor/plugins.nix +++ b/krebs/5pkgs/simple/Reaktor/plugins.nix @@ -144,7 +144,7 @@ rec { taskwarrior = buildSimpleReaktorPlugin "task" { pattern = "^task: (?P.*)$$"; script = pkgs.writeDash "task-wrapper" '' - task "$*" + ${pkgs.taskwarrior}/bin/task "$*" ''; }; -- cgit v1.2.3 From d6df7ae483b984b90bdc8d4540301ef394885a98 Mon Sep 17 00:00:00 2001 From: jeschli Date: Tue, 3 Jul 2018 22:22:49 +0200 Subject: Reaktor taskwarrior: touch if no taskrc exists --- krebs/5pkgs/simple/Reaktor/plugins.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'krebs/5pkgs') diff --git a/krebs/5pkgs/simple/Reaktor/plugins.nix b/krebs/5pkgs/simple/Reaktor/plugins.nix index cd389366e..7573c9256 100644 --- a/krebs/5pkgs/simple/Reaktor/plugins.nix +++ b/krebs/5pkgs/simple/Reaktor/plugins.nix @@ -143,9 +143,15 @@ rec { taskwarrior = buildSimpleReaktorPlugin "task" { pattern = "^task: (?P.*)$$"; - script = pkgs.writeDash "task-wrapper" '' - ${pkgs.taskwarrior}/bin/task "$*" - ''; + script = let + taskrc = "$HOME/.taskrc"; + in + pkgs.writeDash "task-wrapper" '' + if [ -f ${taskrc} ] ; then + touch ${taskrc} + fi + ${pkgs.taskwarrior}/bin/task "$*" + ''; }; todo = name: { -- cgit v1.2.3 From 92aa5bb2329c39cf97d4399839989e7401820ae4 Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 6 Jul 2018 17:42:04 +0200 Subject: Reaktor url-title: fix some issues with weird urls ref: https://irc-bot-science.clsr.net/ --- krebs/5pkgs/simple/Reaktor/plugins.nix | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'krebs/5pkgs') diff --git a/krebs/5pkgs/simple/Reaktor/plugins.nix b/krebs/5pkgs/simple/Reaktor/plugins.nix index cd389366e..4a7917b68 100644 --- a/krebs/5pkgs/simple/Reaktor/plugins.nix +++ b/krebs/5pkgs/simple/Reaktor/plugins.nix @@ -121,21 +121,27 @@ rec { pattern = "^.*(?Phttp[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+).*$$"; path = with pkgs; [ curl perl ]; script = pkgs.writePython3 "url-title" [ "beautifulsoup4" "lxml" ] '' + import cgi import sys import urllib.request from bs4 import BeautifulSoup try: - soup = BeautifulSoup(urllib.request.urlopen(sys.argv[1]), "lxml") - title = soup.find('title').string + resp = urllib.request.urlopen(sys.argv[1]) + if resp.headers['content-type'].find('text/html') >= 0: + soup = BeautifulSoup(resp.read(16000), "lxml") + title = soup.find('title').string - if title: - if len(title) > 512: - print('message to long, skipped') - elif len(title.split('\n')) > 5: - print('to many lines, skipped') - else: - print(title) + if title: + if len(title) > 450: + print('message to long, rest skipped') + elif len(title.split('\n')) > 5: + print('to many lines, skipped') + else: + print(title) + else: + cd_header = resp.headers['content-disposition'] + print(cgi.parse_header(cd_header)[1]['filename']) except: # noqa: E722 pass ''; -- cgit v1.2.3 From 48fdd37c032bfb2e53ca94ee5b48633a24e1e897 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 7 Jul 2018 14:40:59 +0200 Subject: Reaktor url-title: show 450 chars max --- krebs/5pkgs/simple/Reaktor/plugins.nix | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'krebs/5pkgs') diff --git a/krebs/5pkgs/simple/Reaktor/plugins.nix b/krebs/5pkgs/simple/Reaktor/plugins.nix index 4a7917b68..3730b9e66 100644 --- a/krebs/5pkgs/simple/Reaktor/plugins.nix +++ b/krebs/5pkgs/simple/Reaktor/plugins.nix @@ -127,18 +127,17 @@ rec { from bs4 import BeautifulSoup try: - resp = urllib.request.urlopen(sys.argv[1]) + req = urllib.request.Request(sys.argv[1]) + req.add_header('user-agent', 'Reaktor-url-title') + resp = urllib.request.urlopen(req) if resp.headers['content-type'].find('text/html') >= 0: soup = BeautifulSoup(resp.read(16000), "lxml") title = soup.find('title').string - if title: - if len(title) > 450: - print('message to long, rest skipped') - elif len(title.split('\n')) > 5: - print('to many lines, skipped') - else: - print(title) + if len(title.split('\n')) > 5: + title = '\n'.join(title.split('\n')[:5]) + + print(title[:450]) else: cd_header = resp.headers['content-disposition'] print(cgi.parse_header(cd_header)[1]['filename']) -- cgit v1.2.3 From ea4fe76393a527eb4a754d0c8a8fa35de2bd20e5 Mon Sep 17 00:00:00 2001 From: jeschli Date: Tue, 10 Jul 2018 20:35:38 +0200 Subject: Reaktor: taskwarrior -> task-{add,delete,list} --- krebs/5pkgs/simple/Reaktor/plugins.nix | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) (limited to 'krebs/5pkgs') diff --git a/krebs/5pkgs/simple/Reaktor/plugins.nix b/krebs/5pkgs/simple/Reaktor/plugins.nix index 7573c9256..96e0af2d7 100644 --- a/krebs/5pkgs/simple/Reaktor/plugins.nix +++ b/krebs/5pkgs/simple/Reaktor/plugins.nix @@ -141,16 +141,28 @@ rec { ''; }); - taskwarrior = buildSimpleReaktorPlugin "task" { - pattern = "^task: (?P.*)$$"; - script = let - taskrc = "$HOME/.taskrc"; - in - pkgs.writeDash "task-wrapper" '' - if [ -f ${taskrc} ] ; then - touch ${taskrc} - fi - ${pkgs.taskwarrior}/bin/task "$*" + taskrcFile = builtins.toFile "taskrc" '' + confirmation=no + ''; + + task-add = buildSimpleReaktorPlugin "task-add" { + pattern = "^task-add: (?P.*)$$"; + script = pkgs.writeDash "task-add" '' + ${pkgs.taskwarrior}/bin/task rc:${taskrcFile} add "$*" + ''; + }; + + task-list = buildSimpleReaktorPlugin "task-list" { + pattern = "^task-list"; + script = pkgs.writeDash "task-list" '' + ${pkgs.taskwarrior}/bin/task rc:${taskrcFile} list + ''; + }; + + task-delete = buildSimpleReaktorPlugin "task-delete" { + pattern = "^task-remove: (?P.*)$$"; + script = pkgs.writeDash "task-delete" '' + ${pkgs.taskwarrior}/bin/task rc:${taskrcFile} delete "$*" ''; }; -- cgit v1.2.3