1 { lib, stdenvNoCC, fetchFromGitHub, makeWrapper, curl, jq, coreutils, file }:
3 stdenvNoCC.mkDerivation rec {
7 src = fetchFromGitHub {
11 sha256 = "sha256-ZOGhwR9xFzkm+q0Gm8mSXZ9toXG4xGPNwBQMCVanCbY=";
14 # ignore Makefile by disabling buildPhase. Upstream Makefile tries to download
15 # binaries from the internet for linting
18 # discord.sh looks for the .webhook file in the source code directory, which
19 # isn't mutable on Nix
21 substituteInPlace discord.sh \
22 --replace 'thisdir="$(cd "$(dirname "$(readlink -f "''${BASH_SOURCE[0]}")")" && pwd)"' 'thisdir="$(pwd)"'
25 nativeBuildInputs = [ makeWrapper ];
27 doInstallCheck = true;
29 installCheckPhase = ''
31 $out/bin/discord.sh --help
37 install -Dm555 discord.sh $out/bin/discord.sh
38 wrapProgram $out/bin/discord.sh \
39 --set PATH "${lib.makeBinPath [ curl jq coreutils file ]}"
44 description = "Write-only command-line Discord webhook integration written in 100% Bash script";
45 mainProgram = "discord.sh";
46 homepage = "https://github.com/ChaoticWeg/discord.sh";
47 license = licenses.gpl3;
48 platforms = platforms.unix;
49 maintainers = with maintainers; [ matthewcroughan ];