-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsmithy-cli.nix
More file actions
54 lines (49 loc) · 1.45 KB
/
smithy-cli.nix
File metadata and controls
54 lines (49 loc) · 1.45 KB
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
50
51
52
53
54
{
lib,
stdenv,
fetchzip,
jdk17,
}:
let
version = "1.66.0";
smithy-platform = lib.pipe stdenv.hostPlatform.system (
with builtins;
[
## Converts 'x86_64-linux' into 'linux-x86_64'.
(split "-")
(filter (x: builtins.typeOf x == "string" && x != ""))
lib.lists.reverseList
(concatStringsSep "-")
]
);
sha256 = if stdenv.hostPlatform.system == "aarch64-darwin" then
"sha256-lBrvWhKv542jHlc9nNbOIY9Y3hd3gZ1soslbANh8enA="
else if stdenv.hostPlatform.system == "aarch64-linux" then
"0073q61mlpvrmqkxqc34jkmydsv09lgnwi0n4wy1xjwawyybrnvi"
else if stdenv.hostPlatform.system == "x86_64-linux" then
"17lj0zjvpinv4hd779wbiph4pdawv28yngxrj4811z88k1nhmmap"
else "";
in
stdenv.mkDerivation {
name = "smithy-cli";
inherit version;
src = fetchzip {
url = "https://github.com/smithy-lang/smithy/releases/download/${version}/smithy-cli-${smithy-platform}.zip";
inherit sha256;
};
dontConfigure = true;
dontBuild = true;
installPhase = ''
./install -i $out -b $out/bin
## Need this othewise it won't run on nixos machines.
## NOTE One can try to patchelf the provided java bin, but this works for now.
ln -sf ${jdk17}/bin/java $out/bin/java
'';
meta = with lib; {
description = "CLI for the Smithy IDL (Interface Definition Language)";
homepage = "https://github.com/smithy-lang/smithy";
license = licenses.asl20;
platforms = platforms.all;
maintainers = [ ];
};
}