1{
2 lib,
3 stdenv,
4 fetchurl,
5 unzip,
6}:
7
8let
9 inherit (stdenv.hostPlatform) system;
10 throwSystem = throw "Unsupported system: ${system}";
11
12 os =
13 {
14 x86_64-darwin = "darwin";
15 x86_64-linux = "linux";
16 }
17 .${system} or throwSystem;
18
19 sha256 =
20 {
21 x86_64-darwin = "sha256-OIyEu3Hsobui9s5+T9nC10SxMw0MhgmTA4SN9Ridyzo=";
22 x86_64-linux = "sha256-SxBjRd95hoh2zwX6IDnkZnTWVduQafPHvnWw8qTuM78=";
23 }
24 .${system} or throwSystem;
25in
26stdenv.mkDerivation rec {
27 pname = "flywheel-cli";
28 version = "16.2.0";
29
30 src = fetchurl {
31 url = "https://storage.googleapis.com/flywheel-dist/cli/${version}/fw-${os}_amd64-${version}.zip";
32 inherit sha256;
33 };
34
35 nativeBuildInputs = [ unzip ];
36
37 unpackPhase = ''
38 unzip ${src}
39 '';
40
41 installPhase = ''
42 runHook preInstall
43 install -Dt $out/bin ./${os}_amd64/fw
44 runHook postInstall
45 '';
46
47 meta = with lib; {
48 description = "Library and command line interface for interacting with a Flywheel site";
49 mainProgram = "fw";
50 homepage = "https://gitlab.com/flywheel-io/public/python-cli";
51 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
52 license = licenses.mit;
53 maintainers = with maintainers; [ rbreslow ];
54 platforms = [
55 "x86_64-darwin"
56 "x86_64-linux"
57 ];
58 };
59}