-
Notifications
You must be signed in to change notification settings - Fork 1
/
encore.nix
56 lines (47 loc) · 1.11 KB
/
encore.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
50
51
52
53
54
55
56
{ stdenv, lib, fetchurl, autoPatchelfHook }:
let
release = import ./release.nix;
in
stdenv.mkDerivation rec
{
pname = "encore";
version = release.version;
system = {
"x86_64-linux" = "linux_amd64";
"x86_64-darwin" = "darwin_amd64";
"aarch64-linux" = "linux_arm64";
"aarch64-darwin" = "darwin_arm64";
}.${stdenv.targetPlatform.system};
checksum = release.checksums.${system};
src = fetchurl {
url = "https://d2f391esomvqpi.cloudfront.net/${pname}-${version}-${system}.tar.gz";
sha256 = checksum;
};
dontBuild = true;
nativeBuildInputs = [
autoPatchelfHook
];
buildInputs = [ ];
unpackPhase = ''
tar -C ./ -xzf ${src}
'';
installPhase = ''
mkdir -p $out/bin
mkdir -p $out/runtimes
mkdir -p $out/encore-go
cp -r ./bin/* $out/bin/
cp -r ./runtimes/* $out/runtimes/
cp -r ./encore-go/* $out/encore-go/
'';
meta = {
description = "encore cli";
homepage = "https://encore.dev";
license = lib.licenses.mpl20;
platforms = [
"x86_64-linux"
"x86_64-darwin"
"aarch64-linux"
"aarch64-darwin"
];
};
}