From b04c1b09ea6b6e28f30f9ca879c8530105592778 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sun, 13 Jun 2021 18:37:11 +0200 Subject: [PATCH] pkgs: add matrix-notifier --- pkgs/default.nix | 2 ++ pkgs/matrix-notifier/default.nix | 45 ++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 pkgs/matrix-notifier/default.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index 7419501..ede7620 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -14,6 +14,8 @@ rec { lohr = pkgs.callPackage ./lohr { }; + matrix-notifier = pkgs.callPackage ./matrix-notifier { }; + nolimips = pkgs.callPackage ./nolimips { }; vimix-cursors = pkgs.callPackage ./vimix-cursors { }; diff --git a/pkgs/matrix-notifier/default.nix b/pkgs/matrix-notifier/default.nix new file mode 100644 index 0000000..3f60455 --- /dev/null +++ b/pkgs/matrix-notifier/default.nix @@ -0,0 +1,45 @@ +{ curl, jq, fetchFromGitHub, lib, makeWrapper, stdenvNoCC }: +stdenvNoCC.mkDerivation rec { + pname = "matrix-notifier"; + version = "0.1.0"; + + src = fetchFromGitHub { + owner = "ambroisie"; + repo = "matrix-notifier"; + rev = "v${version}"; + sha256 = "sha256-MbtxLUVL4bBS66TJTXky/0blR9lFKzLkRccck7Um2Co="; + }; + + phases = [ "installPhase" "fixupPhase" ]; + + nativeBuildInputs = [ + makeWrapper + ]; + + installPhase = '' + mkdir -p $out/bin + cp $src/${pname} $out/bin/${pname} + chmod a+x $out/bin/${pname} + ''; + + wrapperPath = lib.makeBinPath [ + curl + jq + ]; + + fixupPhase = '' + patchShebangs $out/bin/${pname} + wrapProgram $out/bin/${pname} --prefix PATH : "${wrapperPath}" + ''; + + meta = with lib; { + description = '' + A very simple bash script that can be used to send a message to + a Matrix room + ''; + homepage = "https://gitea.belanyi.fr/ambroisie/${pname}"; + license = licenses.mit; + platforms = platforms.unix; + maintainers = with maintainers; [ ambroisie ]; + }; +}