diff options
author | jeschli <jeschli@gmail.com> | 2019-04-23 20:15:10 +0200 |
---|---|---|
committer | jeschli <jeschli@gmail.com> | 2019-04-23 20:15:10 +0200 |
commit | 35fdfbe5ccb3b5844b62ac2486352107484e75d4 (patch) | |
tree | 561ff21ae90ce6826ab3d74ebd9f27dee7054a0d /krebs/5pkgs | |
parent | a4be985644762dcc2750a366db5780687690ef7d (diff) | |
parent | cd825d99342050bae35d5373e927ca999bae82cf (diff) |
Merge branch 'master' of prism.r:stockholm
Diffstat (limited to 'krebs/5pkgs')
-rw-r--r-- | krebs/5pkgs/haskell/blessings.nix | 4 | ||||
-rw-r--r-- | krebs/5pkgs/haskell/email-header.nix | 5 | ||||
-rw-r--r-- | krebs/5pkgs/simple/kpaste/default.nix | 5 | ||||
-rw-r--r-- | krebs/5pkgs/simple/krebspaste/default.nix | 12 | ||||
-rw-r--r-- | krebs/5pkgs/simple/qrscan.nix | 27 |
5 files changed, 48 insertions, 5 deletions
diff --git a/krebs/5pkgs/haskell/blessings.nix b/krebs/5pkgs/haskell/blessings.nix index f730cc72b..c35706ebf 100644 --- a/krebs/5pkgs/haskell/blessings.nix +++ b/krebs/5pkgs/haskell/blessings.nix @@ -10,6 +10,10 @@ with import <stockholm/lib>; version = "2.2.0"; sha256 = "1pb56dgf3jj2kq3cbbppwzyg3ccgqy9xara62hkjwyxzdx20clk1"; }; + "19.03" = { + version = "2.2.0"; + sha256 = "1pb56dgf3jj2kq3cbbppwzyg3ccgqy9xara62hkjwyxzdx20clk1"; + }; }.${versions.majorMinor nixpkgsVersion}; in mkDerivation { diff --git a/krebs/5pkgs/haskell/email-header.nix b/krebs/5pkgs/haskell/email-header.nix index 4049168c1..6689f1d2c 100644 --- a/krebs/5pkgs/haskell/email-header.nix +++ b/krebs/5pkgs/haskell/email-header.nix @@ -15,6 +15,11 @@ with import <stockholm/lib>; rev = "refs/tags/v${cfg.version}"; sha256 = "11xjivpj495r2ss9aqljnpzzycb57cm4sr7yzmf939rzwsd3ib0x"; }; + "19.03" = { + version = "0.4.1-tv1"; + rev = "refs/tags/v${cfg.version}"; + sha256 = "11xjivpj495r2ss9aqljnpzzycb57cm4sr7yzmf939rzwsd3ib0x"; + }; }.${versions.majorMinor nixpkgsVersion}; in mkDerivation { diff --git a/krebs/5pkgs/simple/kpaste/default.nix b/krebs/5pkgs/simple/kpaste/default.nix index d6823d584..217cb8a44 100644 --- a/krebs/5pkgs/simple/kpaste/default.nix +++ b/krebs/5pkgs/simple/kpaste/default.nix @@ -1,5 +1,6 @@ -{ curl, writeDashBin }: +{ curl, gnused, writeDashBin }: writeDashBin "kpaste" '' - exec ${curl}/bin/curl -sS http://p.r --data-binary @- + ${curl}/bin/curl -sS http://p.r --data-binary @- | + ${gnused}/bin/sed '$ {p;s/\<r\>/krebsco.de/}' '' diff --git a/krebs/5pkgs/simple/krebspaste/default.nix b/krebs/5pkgs/simple/krebspaste/default.nix index a11c8c90a..d97b6a053 100644 --- a/krebs/5pkgs/simple/krebspaste/default.nix +++ b/krebs/5pkgs/simple/krebspaste/default.nix @@ -1,6 +1,12 @@ -{ writeDashBin, bepasty-client-cli }: +{ bepasty-client-cli, gnused, writeDashBin }: -# TODO use `pkgs.exec` instead? writeDashBin "krebspaste" '' - exec ${bepasty-client-cli}/bin/bepasty-cli -L 1m --url http://paste.r "$@" | sed '$ s/$/\/+inline/g' + ${bepasty-client-cli}/bin/bepasty-cli -L 1m --url http://paste.r "$@" | + ${gnused}/bin/sed ' + $ { + s/$/\/+inline/ + p + s/\<r\>/krebsco.de/ + } + ' '' diff --git a/krebs/5pkgs/simple/qrscan.nix b/krebs/5pkgs/simple/qrscan.nix new file mode 100644 index 000000000..7d99dcee7 --- /dev/null +++ b/krebs/5pkgs/simple/qrscan.nix @@ -0,0 +1,27 @@ +{ coreutils, gnused, writeDashBin, zbar }: + +writeDashBin "qrscan" '' + set -efu + + tmpdir=$(${coreutils}/bin/mktemp --tmpdir -d qrscan.XXXXXXXX) + codefile=$tmpdir/code + + cleanup() { + ${coreutils}/bin/rm "$codefile" + ${coreutils}/bin/rmdir "$tmpdir" + } + + ${coreutils}/bin/mkfifo "$codefile" + + ${zbar}/bin/zbarcam > "$codefile" & + zbarcampid=$! + + exec < "$codefile" + while read -r code; do + code=$(printf %s "$code" | ${gnused}/bin/sed -n 's/^QR-Code://p') + if test -n "$code"; then + ${coreutils}/bin/kill "$zbarcampid" + echo "$code" + fi + done +'' |