about summary refs log tree commit diff
path: root/pkgs/shells/zsh/gradle-completion/default.nix
blob: 9a3f5ec3cc49ffd235db1be31c88a0d5b365d7e3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{ stdenv, fetchFromGitHub }:

stdenv.mkDerivation rec {
  name = "gradle-completion-${version}";
  version = "1.3.1";

  src = fetchFromGitHub {
    owner = "gradle";
    repo = "gradle-completion";
    rev = "v${version}";
    sha256 = "02vv360r78ckwc6r4xbhmy5dxz6l9ya4lq9c62zh12ciq94y9kgx";
  };

  # we just move two files into $out,
  # this shouldn't bother Hydra.
  preferLocalBuild = true;

  dontBuild = true;
  installPhase = ''
    runHook preInstall

    mkdir -p $out
    install -Dm0644 ./_gradle $out/share/zsh/site-functions/_gradle
    install -Dm0644 ./gradle-completion.bash $out/share/bash-completion/completions/gradle

    runHook postInstall
  '';

  meta = with stdenv.lib; {
    description = "Gradle tab completion for bash and zsh";
    homepage = https://github.com/gradle/gradle-completion;
    license = licenses.mit;
    maintainers = with maintainers; [ ma27 ];
  };
}