Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 72 lines 1.9 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchurl, 5 makeBinaryWrapper, 6 jre11_minimal, 7 jdk11_headless, 8 versionCheckHook, 9 nix-update-script, 10}: 11let 12 jre11_minimal_headless = jre11_minimal.override { 13 jdk = jdk11_headless; 14 modules = [ 15 "java.logging" 16 ]; 17 }; 18in 19stdenv.mkDerivation (finalAttrs: { 20 pname = "rundeck-cli"; 21 version = "2.0.9"; 22 23 src = fetchurl { 24 url = "https://github.com/rundeck/rundeck-cli/releases/download/v${finalAttrs.version}/rundeck-cli-${finalAttrs.version}-all.jar"; 25 hash = "sha256-c6QAgwyRCtoOlS7DEmjyK3BwHV122bilL6H+Hzrv2dQ="; 26 }; 27 28 nativeBuildInputs = [ makeBinaryWrapper ]; 29 buildInputs = [ jre11_minimal_headless ]; 30 31 dontUnpack = true; 32 33 installPhase = '' 34 runHook preInstall 35 36 mkdir -p $out/share/rundeck-cli 37 cp $src $out/share/rundeck-cli/rundeck-cli.jar 38 39 mkdir -p $out/bin 40 makeWrapper ${lib.getExe jre11_minimal_headless} $out/bin/rd \ 41 --add-flags "-jar $out/share/rundeck-cli/rundeck-cli.jar" 42 43 runHook postInstall 44 ''; 45 46 nativeInstallCheckInputs = [ 47 versionCheckHook 48 ]; 49 versionCheckProgram = "${placeholder "out"}/bin/rd"; 50 versionCheckProgramArg = "--version"; 51 doInstallCheck = true; 52 53 passthru = { 54 updateScript = nix-update-script { }; 55 }; 56 57 meta = { 58 description = "Official CLI tool for Rundeck"; 59 longDescription = '' 60 The rd command provides command line access to the Rundeck HTTP API, 61 allowing you to access and control your Rundeck server from the 62 command line or shell scripts. 63 ''; 64 homepage = "https://github.com/rundeck/rundeck-cli"; 65 changelog = "https://github.com/rundeck/rundeck-cli/blob/v${finalAttrs.version}/docs/changes.md"; 66 sourceProvenance = [ lib.sourceTypes.binaryBytecode ]; 67 license = lib.licenses.asl20; 68 platforms = lib.platforms.unix; 69 maintainers = with lib.maintainers; [ liberodark ]; 70 mainProgram = "rd"; 71 }; 72})