summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'krebs/5pkgs')
-rw-r--r--krebs/5pkgs/Reaktor/scripts/sed-plugin.py18
-rw-r--r--krebs/5pkgs/goify/default.nix15
-rw-r--r--krebs/5pkgs/haskell-overrides/news.nix18
-rw-r--r--krebs/5pkgs/weechat/default.nix4
4 files changed, 38 insertions, 17 deletions
diff --git a/krebs/5pkgs/Reaktor/scripts/sed-plugin.py b/krebs/5pkgs/Reaktor/scripts/sed-plugin.py
index 22b48e59d..da8e2f726 100644
--- a/krebs/5pkgs/Reaktor/scripts/sed-plugin.py
+++ b/krebs/5pkgs/Reaktor/scripts/sed-plugin.py
@@ -3,15 +3,17 @@
# Usage:
# _from=krebs state_dir=. python sed-plugin.py 'dick butt'
# _from=krebs state_dir=. python sed-plugin.py 's/t/l/g'
-## dick bull
+# > dick bull
import shelve
from os import environ
from os.path import join
from sys import argv
-d = shelve.open(join(environ['state_dir'],'sed-plugin.shelve'),writeback=True)
-usr = environ['_from']
import re
+d = shelve.open(join(environ['state_dir'], 'sed-plugin.shelve'), writeback=True)
+usr = environ['_from']
+
+
def is_regex(line):
myre = re.compile(r'^s/(?:\\/|[^/])+/(?:\\/|[^/])*/[ig]?$')
return myre.match(line)
@@ -19,15 +21,15 @@ def is_regex(line):
line = argv[1]
if is_regex(line):
- last = d.get(usr,None)
+ last = d.get(usr, None)
if last:
- from subprocess import Popen,PIPE
- p = Popen(['sed',line],stdin=PIPE,stdout=PIPE)
- so,se = p.communicate(bytes("{}\n".format(last),"UTF-8"))
+ from subprocess import Popen, PIPE
+ p = Popen(['sed', line], stdin=PIPE, stdout=PIPE)
+ so, se = p.communicate(bytes("{}\n".format(last), "UTF-8"))
if p.returncode:
print("something went wrong when trying to process your regex: {}".format(se.decode()))
ret = so.decode()
- print("\x1b[1m{}\x1b[0m meinte: {}".format(usr,ret.strip()))
+ print("\x1b[1m{}\x1b[0m meant: {}".format(usr, ret.strip()))
if ret:
d[usr] = ret
diff --git a/krebs/5pkgs/goify/default.nix b/krebs/5pkgs/goify/default.nix
index e2849b5c7..9c44aaeeb 100644
--- a/krebs/5pkgs/goify/default.nix
+++ b/krebs/5pkgs/goify/default.nix
@@ -1,17 +1,18 @@
{ pkgs, ... }:
-pkgs.writeDashBin "goify" ''
+pkgs.writeBashBin "goify" ''
set -euf
GO_HOST=''${GO_HOST:-go}
while read line; do
- echo "$line" | sed -E 's|https?://\S*|\n&\n|g' | while read word; do
- if echo "$word" | grep -Eq ^https?:; then
- ${pkgs.curl}/bin/curl -Ss -F uri="$word" http://"$GO_HOST" | tr -d '\r'
+ echo "$line" | sed 's|https\?://\S*|\n&\n|g' | while read word; do
+ if echo "$word" | grep -q '^https\?:'; then
+ ${pkgs.curl}/bin/curl -Ss -F uri="$word" http://"$GO_HOST" \
+ | tr -d '\r'
else
- echo "$word";
- fi;
- done | sed '/^$/d' | tr '\n' ' '; echo;
+ echo "$word"
+ fi
+ done | grep . | tr '\n' ' '; echo
done
''
diff --git a/krebs/5pkgs/haskell-overrides/news.nix b/krebs/5pkgs/haskell-overrides/news.nix
new file mode 100644
index 000000000..ba5e7a5e1
--- /dev/null
+++ b/krebs/5pkgs/haskell-overrides/news.nix
@@ -0,0 +1,18 @@
+{ mkDerivation, base, bloomfilter, bytestring, feed, fetchgit, lens
+, stdenv, wreq
+}:
+mkDerivation {
+ pname = "news";
+ version = "1.0.0";
+ src = fetchgit {
+ url = "http://cgit.lassul.us/news";
+ sha256 = "1n3ffr2a5irr5aly0y7qsafag3kxvyyh077ayk0vdwbd0s9hvnjs";
+ rev = "c3eb2c0a1a34fc41e18d0bc99b1c4dc73aa6eb20";
+ };
+ isLibrary = false;
+ isExecutable = true;
+ executableHaskellDepends = [
+ base bloomfilter bytestring feed lens wreq
+ ];
+ license = stdenv.lib.licenses.mit;
+}
diff --git a/krebs/5pkgs/weechat/default.nix b/krebs/5pkgs/weechat/default.nix
index f5dc6a8d4..c703ca8bf 100644
--- a/krebs/5pkgs/weechat/default.nix
+++ b/krebs/5pkgs/weechat/default.nix
@@ -21,12 +21,12 @@ let
in
stdenv.mkDerivation rec {
- version = "1.7.1";
+ version = "1.8";
name = "weechat-${version}";
src = fetchurl {
url = "http://weechat.org/files/src/weechat-${version}.tar.bz2";
- sha256 = "1020m1lsm8lg9n0dlxgp2wbn9b0r11g8r0namnzi2x6gvxn7iyf0";
+ sha256 = "10km0437lg9ms6f16h20s89l2w9f9g597rykybxb16s95ql48z08";
};
outputs = [ "out" "doc" ];