-
Notifications
You must be signed in to change notification settings - Fork 6
/
shell.nix
49 lines (41 loc) · 1.23 KB
/
shell.nix
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
48
49
{ pkgs ? import <nixpkgs> {} }:
let
inherit (pkgs.stdenv.hostPlatform) system;
releases = {
"x86_64-linux" = {
name = "astra-cli-0.5-linux.zip";
hash = "sha256-Gr+OIi2M/05DWV4XjZ8fDxeXyUyz/tUT/Qzl9BhvXog=";
};
"aarch64-linux" = {
name = "astra-cli-0.5-linux.zip";
hash = "sha256-Gr+OIi2M/05DWV4XjZ8fDxeXyUyz/tUT/Qzl9BhvXog=";
};
"x86_64-darwin" = {
name = "astra-cli-0.5-mac.zip";
hash = "sha256-g7wAyNSDns6y+XB+dbBeYILEm2jDFYNvZCm/U9N+fk8=";
};
"aarch64-darwin" = {
name = "astra-cli-0.5-mac.zip";
hash = "sha256-g7wAyNSDns6y+XB+dbBeYILEm2jDFYNvZCm/U9N+fk8=";
};
}.${system} or (throw "Unsupported system: ${system}");
astra = pkgs.stdenv.mkDerivation rec {
pname = "astra";
version = "0.5";
nativeBuildInputs = with pkgs; [ unzip ];
src = pkgs.fetchurl {
url = "https://github.com/datastax/astra-cli/releases/download/${version}/${releases.name}";
hash = releases.hash;
};
unpackPhase = ''
unzip $src
'';
installPhase = ''
install -m755 -D astra $out/bin/${pname}
install -m755 -D astra-init.sh $out/bin/${pname}-init
'';
};
in
pkgs.mkShell {
packages = [ pkgs.nodejs_20 pkgs.jq astra ];
}