2018-08-15 09:56:04 +01:00
|
|
|
# slack-cli must be configured using the SLACK_CLI_TOKEN environment
|
|
|
|
# variable. Using `slack init` will not work because it tries to write
|
|
|
|
# to the Nix store.
|
|
|
|
|
2018-08-15 11:36:28 +01:00
|
|
|
{ stdenv, lib, fetchFromGitHub, makeWrapper, curl, jq }:
|
2018-08-15 09:56:04 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2018-08-15 12:28:43 +01:00
|
|
|
name = "slack-cli-${version}";
|
2018-08-15 09:56:04 +01:00
|
|
|
version = "0.18.0";
|
|
|
|
|
2018-08-15 11:36:28 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rockymadden";
|
|
|
|
repo = "slack-cli";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "022yr3cpfg0v7cxi62zzk08vp0l3w851qpfh6amyfgjiynnfyddl";
|
2018-08-15 09:56:04 +01:00
|
|
|
};
|
|
|
|
|
2018-08-15 12:32:00 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2018-08-15 09:56:04 +01:00
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
2018-08-15 12:32:19 +01:00
|
|
|
mkdir -p "$out/bin"
|
|
|
|
cp src/slack "$out/bin"
|
|
|
|
wrapProgram "$out/bin/slack" --prefix PATH : ${lib.makeBinPath [ curl jq ]}
|
2018-08-15 09:56:04 +01:00
|
|
|
'';
|
|
|
|
}
|