Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 80 lines 2.1 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchzip, 5}: 6 7stdenv.mkDerivation rec { 8 pname = "vault-bin"; 9 version = "1.20.0"; 10 11 src = 12 let 13 inherit (stdenv.hostPlatform) system; 14 selectSystem = attrs: attrs.${system} or (throw "Unsupported system: ${system}"); 15 suffix = selectSystem { 16 x86_64-linux = "linux_amd64"; 17 aarch64-linux = "linux_arm64"; 18 i686-linux = "linux_386"; 19 x86_64-darwin = "darwin_amd64"; 20 aarch64-darwin = "darwin_arm64"; 21 }; 22 hash = selectSystem { 23 x86_64-linux = "sha256-wfp3qQ6vKE/k9lKW+h2LSVG9C/+4yJxsjksg5asfSj4="; 24 aarch64-linux = "sha256-pEnKCiZHrO5xwkfSA1bsqrtASj9BRNTsoTPJdu4hulE="; 25 i686-linux = "sha256-jsQFuiY1F8rSDaqtTdjbOaAfh0/WEITkXkmxgcH8U9g="; 26 x86_64-darwin = "sha256-tT6W9DJu6sehfAkbWmE4Z4MradJM50Ps2iWraQANUok="; 27 aarch64-darwin = "sha256-2bDtbRnMOCF91AZSMaBEgnwLDX44BRHv6Wb1UqZ86Ks="; 28 }; 29 in 30 fetchzip { 31 url = "https://releases.hashicorp.com/vault/${version}/vault_${version}_${suffix}.zip"; 32 stripRoot = false; 33 inherit hash; 34 }; 35 36 dontConfigure = true; 37 dontBuild = true; 38 dontStrip = stdenv.hostPlatform.isDarwin; 39 40 installPhase = '' 41 runHook preInstall 42 install -D vault $out/bin/vault 43 runHook postInstall 44 ''; 45 46 doInstallCheck = true; 47 installCheckPhase = '' 48 runHook preInstallCheck 49 $out/bin/vault --help 50 $out/bin/vault version 51 runHook postInstallCheck 52 ''; 53 54 dontPatchELF = true; 55 dontPatchShebangs = true; 56 57 passthru.updateScript = ./update-bin.sh; 58 59 meta = with lib; { 60 description = "Tool for managing secrets, this binary includes the UI"; 61 homepage = "https://www.vaultproject.io"; 62 sourceProvenance = with sourceTypes; [ binaryNativeCode ]; 63 license = licenses.bsl11; 64 maintainers = with maintainers; [ 65 offline 66 psyanticy 67 Chili-Man 68 techknowlogick 69 ]; 70 teams = [ teams.serokell ]; 71 mainProgram = "vault"; 72 platforms = [ 73 "x86_64-linux" 74 "i686-linux" 75 "x86_64-darwin" 76 "aarch64-darwin" 77 "aarch64-linux" 78 ]; 79 }; 80}