-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdefault.nix
36 lines (36 loc) · 1.19 KB
/
default.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
{ pkgs ? import <nixpkgs> { } }:
with pkgs;
let
download = { name, version, url, sha256, taropt ? "" }:
stdenv.mkDerivation ({
inherit name version;
phases = [ "installPhase" ];
installPhase = ''
mkdir -p $out/bin
tar zxvf $src ${taropt} -C $out/bin 2> /dev/null || install -m 755 $src $out/bin/${name}
'';
src = fetchurl { inherit url sha256; };
});
motoko = download (rec {
name = "motoko";
version = "0.6.4";
url =
"https://github.com/dfinity/motoko/releases/download/${version}/motoko-linux64-${version}.tar.gz";
sha256 = "sha256-ntPzPyLZwrLZk/4JQL6vAvtGhu3/Z2nrgipq8zfCPSg=";
});
binaryen = download (rec {
taropt = "--strip-component=1";
name = "binaryen";
version = "version_96";
url =
"https://github.com/WebAssembly/binaryen/releases/download/${version}/binaryen-${version}-x86_64-linux.tar.gz";
sha256 = "sha256-n4OXoSkx31d7JEonwpPXyXa8fpgKEkV4OfRvggKTWqw=";
});
in with pkgs;
pkgs.stdenv.mkDerivation {
name = "ic-blackhole";
version = "0.0.0";
src = ./.;
nativeBuildInputs = [ binaryen motoko jq gnumake ];
installPhase = "mkdir -p $out/bin && install -m 644 dist/* $out/bin/";
}