From 6c826001614f78bac48d751a1c03c62bb98b8f05 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 18 Mar 2022 16:01:57 +0100 Subject: git-hooks irc-announce: add verbose blacklist --- krebs/5pkgs/simple/git-hooks/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'krebs/5pkgs/simple') diff --git a/krebs/5pkgs/simple/git-hooks/default.nix b/krebs/5pkgs/simple/git-hooks/default.nix index c9dcc7541..13fe7aa67 100644 --- a/krebs/5pkgs/simple/git-hooks/default.nix +++ b/krebs/5pkgs/simple/git-hooks/default.nix @@ -96,7 +96,12 @@ with stockholm.lib; #$host $GIT_SSH_REPO $ref $link add_message $(pink push) $link $(gray "($receive_mode)") - ${optionalString verbose /* sh */ '' + ${optionalString (verbose == false || typeOf verbose == "set") /* sh */ '' + ${optionalString (verbose.exclude or [] != []) /* sh */ '' + case $ref in (${concatStringsSep "|" verbose.exclude}) + continue + esac + ''} add_message "$( git log \ --format="$(orange %h) %s $(gray '(%ar)')" \ -- cgit v1.2.3 From 1fc622cd0835882d4d565f216af72e2881815b7b Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 22 Mar 2022 19:34:57 +0100 Subject: qrscan: use new one shot scanning mode --- krebs/5pkgs/simple/qrscan.nix | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) (limited to 'krebs/5pkgs/simple') diff --git a/krebs/5pkgs/simple/qrscan.nix b/krebs/5pkgs/simple/qrscan.nix index 7d99dcee7..df9a98053 100644 --- a/krebs/5pkgs/simple/qrscan.nix +++ b/krebs/5pkgs/simple/qrscan.nix @@ -1,27 +1,7 @@ -{ coreutils, gnused, writeDashBin, zbar }: +{ pkgs }: -writeDashBin "qrscan" '' +pkgs.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 + ${pkgs.zbar}/bin/zbarcam -1 | ${pkgs.gnused}/bin/sed -n 's/^QR-Code://p' '' -- cgit v1.2.3 From ba8a0d000ae7b731f7961a8af47b811a881b73a7 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 23 Mar 2022 15:05:42 +0100 Subject: netcat-openbsd -> libressl.nc --- krebs/5pkgs/simple/untilport/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'krebs/5pkgs/simple') diff --git a/krebs/5pkgs/simple/untilport/default.nix b/krebs/5pkgs/simple/untilport/default.nix index 61bcc2b89..2930fd1eb 100644 --- a/krebs/5pkgs/simple/untilport/default.nix +++ b/krebs/5pkgs/simple/untilport/default.nix @@ -13,6 +13,6 @@ pkgs.writeDashBin "untilport" '' if [ $# -ne 2 ]; then usage else - until ${pkgs.netcat-openbsd}/bin/nc -z "$@"; do sleep 1; done + until ${pkgs.libressl.nc}/bin/nc -z "$@"; do sleep 1; done fi '' -- cgit v1.2.3 From 8d3688ecfd4a0f1a8908a0cb471e7b7792d9b54b Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 25 Mar 2022 13:47:56 +0100 Subject: git-hooks irc-announce: verbose == true, not false --- krebs/5pkgs/simple/git-hooks/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'krebs/5pkgs/simple') diff --git a/krebs/5pkgs/simple/git-hooks/default.nix b/krebs/5pkgs/simple/git-hooks/default.nix index 13fe7aa67..3ec43739c 100644 --- a/krebs/5pkgs/simple/git-hooks/default.nix +++ b/krebs/5pkgs/simple/git-hooks/default.nix @@ -96,7 +96,7 @@ with stockholm.lib; #$host $GIT_SSH_REPO $ref $link add_message $(pink push) $link $(gray "($receive_mode)") - ${optionalString (verbose == false || typeOf verbose == "set") /* sh */ '' + ${optionalString (verbose == true || typeOf verbose == "set") /* sh */ '' ${optionalString (verbose.exclude or [] != []) /* sh */ '' case $ref in (${concatStringsSep "|" verbose.exclude}) continue -- cgit v1.2.3 From 1407ad3502a7dd46d6e432b7ccc013bc80341bb1 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 5 Apr 2022 22:16:29 +0200 Subject: pager: init at 1.0.0 --- krebs/5pkgs/simple/pager.nix | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 krebs/5pkgs/simple/pager.nix (limited to 'krebs/5pkgs/simple') diff --git a/krebs/5pkgs/simple/pager.nix b/krebs/5pkgs/simple/pager.nix new file mode 100644 index 000000000..f156f7414 --- /dev/null +++ b/krebs/5pkgs/simple/pager.nix @@ -0,0 +1,34 @@ +{ pkgs }: + +pkgs.writeDashBin "pager" '' + # usage: pager {view,shift,shiftview} + # + # Environment variables + # + # PAGER_NAME (default: Pager) + # The environment variables specifies the application name under which + # resources are to be obtained. PAGER_NAME should not contain “.” or “*” + # characters. + # + set -efu + + pidfile=$XDG_RUNTIME_DIR/pager.lock + name=''${PAGER_NAME-Pager} + + if test -e "$pidfile" && + ${pkgs.procps}/bin/pgrep --pidfile="$pidfile" >/dev/null + then + ${pkgs.procps}/bin/pkill --pidfile="$pidfile" + ${pkgs.coreutils}/bin/rm "$pidfile" + exit + fi + + echo $$ > "$pidfile" + + exec ${pkgs.xterm}/bin/xterm \ + -name "$name" \ + -ti vt340 \ + -xrm 'Pager*geometry: 32x10' \ + -xrm 'Pager*internalBorder: 2' \ + -e ${pkgs.haskellPackages.pager}/bin/pager "$@" +'' -- cgit v1.2.3 From 941476b492f54890a161d7564736b05f083001ed Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 5 Apr 2022 23:06:12 +0200 Subject: pager: add default fg and bg colors --- krebs/5pkgs/simple/pager.nix | 2 ++ 1 file changed, 2 insertions(+) (limited to 'krebs/5pkgs/simple') diff --git a/krebs/5pkgs/simple/pager.nix b/krebs/5pkgs/simple/pager.nix index f156f7414..ed740490d 100644 --- a/krebs/5pkgs/simple/pager.nix +++ b/krebs/5pkgs/simple/pager.nix @@ -30,5 +30,7 @@ pkgs.writeDashBin "pager" '' -ti vt340 \ -xrm 'Pager*geometry: 32x10' \ -xrm 'Pager*internalBorder: 2' \ + -xrm 'Pager*background: #050505' \ + -xrm 'Pager*foreground: #d0d7d0' \ -e ${pkgs.haskellPackages.pager}/bin/pager "$@" '' -- cgit v1.2.3