aboutsummaryrefslogtreecommitdiff
path: root/pkgs/hashi/default.nix
blob: 885282a4f6606ff846837850b497423b0ff23ef4 (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
36
37
38
39
40
41
42
43
44
45
46
47
{
  stdenv,
  fetchurl,
  lib,
  ...
}:
let
  version = "0.1.4";
  sources = {
    aarch64-darwin = {
      url = "https://artifactory.rbx.com:443/artifactory/generic-rbx-local/hashi/${version}/bin/hashi_darwin-arm64";
      sha256 = "sha256-FU7auH1BNdsJsHrWBytK7FJpOll9nx0i29Z5Jd18guI=";
    };
  };
in
stdenv.mkDerivation rec {
  pname = "hashi";
  inherit version;

  src = fetchurl {
    inherit (sources.${stdenv.hostPlatform.system})
      url
      sha256
      ;
  };

  installPhase = ''
    mkdir -p $out/bin
    cp $src $out/bin/hashi
    chmod +x $out/bin/hashi
  '';

  dontUnpack = true;
  dontStrip = true;
  doInstallCheck = true;

  installCheckPhase = ''
    $out/bin/hashi -e sitetest3 version
  '';

  meta = with lib; {
    description = "hashi command-line tool";
    homepage = "http://go/hashicli";
    license = licenses.unfree;
    platforms = [ "aarch64-darwin" ];
  };
}