diff --git a/pkgs/by-name/gr/gradle-completion/package.nix b/pkgs/by-name/gr/gradle-completion/package.nix new file mode 100644 index 0000000000000..0825beef05ba8 --- /dev/null +++ b/pkgs/by-name/gr/gradle-completion/package.nix @@ -0,0 +1,56 @@ +{ + lib, + stdenvNoCC, + fetchFromGitHub, + installShellFiles, + gitUpdater, +}: + +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "gradle-completion"; + version = "1.4.1"; + + src = fetchFromGitHub { + owner = "gradle"; + repo = "gradle-completion"; + rev = "v${finalAttrs.version}"; + sha256 = "15b0692i3h8h7b95465b2aw9qf5qjmjag5n62347l8yl7zbhv3l2"; + }; + + nativeBuildInputs = [ + installShellFiles + ]; + + strictDeps = true; + + # we just move two files into $out, + # this shouldn't bother Hydra. + preferLocalBuild = true; + + dontBuild = true; + + installPhase = '' + runHook preInstall + + # We must specify --name explicitly, + # otherwise bash completions end up + # at .../completions/gradle-completion.bash, + # not .../completions/gradle.bash + installShellCompletion --name gradle \ + --bash gradle-completion.bash \ + --zsh _gradle + + runHook postInstall + ''; + + passthru.updateScript = gitUpdater { + rev-prefix = "v"; + }; + + meta = { + description = "Gradle tab completion for bash and zsh"; + homepage = "https://github.com/gradle/gradle-completion"; + license = lib.licenses.mit; + maintainers = [ ]; + }; +}) diff --git a/pkgs/shells/zsh/gradle-completion/default.nix b/pkgs/shells/zsh/gradle-completion/default.nix deleted file mode 100644 index 6112c2edfa1d6..0000000000000 --- a/pkgs/shells/zsh/gradle-completion/default.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ lib, stdenv, fetchFromGitHub }: - -stdenv.mkDerivation rec { - pname = "gradle-completion"; - version = "1.4.1"; - - src = fetchFromGitHub { - owner = "gradle"; - repo = "gradle-completion"; - rev = "v${version}"; - sha256 = "15b0692i3h8h7b95465b2aw9qf5qjmjag5n62347l8yl7zbhv3l2"; - }; - - strictDeps = true; - - # 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 lib; { - description = "Gradle tab completion for bash and zsh"; - homepage = "https://github.com/gradle/gradle-completion"; - license = licenses.mit; - maintainers = [ ]; - }; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8cc0cbc90f965..5c7f6eb951f79 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14044,8 +14044,6 @@ with pkgs; bash-completion = callPackage ../shells/bash/bash-completion { }; - gradle-completion = callPackage ../shells/zsh/gradle-completion { }; - nix-bash-completions = callPackage ../shells/bash/nix-bash-completions { }; yarn-bash-completion = callPackage ../shells/bash/yarn-completion { };