git-hooks.irc-announce: simplify file structure

This commit is contained in:
tv 2017-03-04 22:49:24 +01:00
parent 6435001c48
commit 286fc7045b

View File

@ -1,13 +1,10 @@
{ lib, pkgs, ... }: { pkgs, ... }:
with lib; with import <stockholm/lib>;
let
out = {
inherit irc-announce;
};
{
# TODO irc-announce should return a derivation # TODO irc-announce should return a derivation
# but it cannot because krebs.git.repos.*.hooks :: attrsOf str
irc-announce = { nick, channel, server, port ? 6667, verbose ? false, branches ? [] }: '' irc-announce = { nick, channel, server, port ? 6667, verbose ? false, branches ? [] }: ''
#! /bin/sh #! /bin/sh
set -euf set -euf
@ -99,7 +96,7 @@ let
done done
if test -n "''${message-}"; then if test -n "''${message-}"; then
exec ${irc-announce-script} \ exec ${pkgs.irc-announce}/bin/irc-announce \
"$server" \ "$server" \
"$port" \ "$port" \
"$nick" \ "$nick" \
@ -107,6 +104,4 @@ let
"$message" "$message"
fi fi
''; '';
}
irc-announce-script = "${pkgs.irc-announce}/bin/irc-announce";
in out