2018-11-30 00:10:35 +01:00
|
|
|
{ fetchurl, stdenv }:
|
|
|
|
|
|
|
|
let
|
2019-10-29 01:36:14 +01:00
|
|
|
version = "0.19.0";
|
2018-11-30 00:10:35 +01:00
|
|
|
|
2019-10-29 01:43:21 +01:00
|
|
|
suffix = {
|
|
|
|
x86_64-linux = "";
|
|
|
|
aarch64-linux = "-aarch64";
|
|
|
|
}."${stdenv.hostPlatform.system}" or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
|
|
|
|
|
|
|
baseurl = "https://github.com/firecracker-microvm/firecracker/releases/download";
|
2018-11-30 00:10:35 +01:00
|
|
|
fetchbin = name: sha256: fetchurl {
|
2019-10-29 01:43:21 +01:00
|
|
|
url = "${baseurl}/v${version}/${name}-v${version}${suffix}";
|
|
|
|
sha256 = sha256."${stdenv.hostPlatform.system}";
|
|
|
|
};
|
|
|
|
|
|
|
|
firecracker-bin = fetchbin "firecracker" {
|
|
|
|
x86_64-linux = "0yjhw77xc2nc96p36jhf0va95gf6hwi9n270g4iiwakycdy048mx";
|
|
|
|
aarch64-linux = "165yca7pcwpqw3x6dihcjz1xcwjh37sdi9qrrjk9zasxx7xcniym";
|
|
|
|
};
|
|
|
|
|
|
|
|
jailer-bin = fetchbin "jailer" {
|
|
|
|
x86_64-linux = "1q792b4bl1q3ach8nc8l0fbcil44knv3wa542xrskndzdz28lhsp";
|
|
|
|
aarch64-linux = "1cnwlpy5bswjprk7fcjgf6lxidhp7z00qx691nkwhzjkby80j490";
|
2018-11-30 00:10:35 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
2019-10-29 01:36:14 +01:00
|
|
|
pname = "firecracker";
|
2018-11-30 00:10:35 +01:00
|
|
|
inherit version;
|
|
|
|
srcs = [ firecracker-bin jailer-bin ];
|
2019-10-29 01:36:14 +01:00
|
|
|
|
|
|
|
unpackPhase = ":";
|
|
|
|
configurePhase = ":";
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
cp ${firecracker-bin} firecracker
|
|
|
|
cp ${jailer-bin} jailer
|
|
|
|
chmod +x firecracker jailer
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
checkPhase = ''
|
|
|
|
./firecracker --version
|
|
|
|
./jailer --version
|
|
|
|
'';
|
2018-11-30 00:10:35 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
2019-10-29 01:36:14 +01:00
|
|
|
install -D firecracker $out/bin/firecracker
|
|
|
|
install -D jailer $out/bin/jailer
|
2018-11-30 00:10:35 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Secure, fast, minimal micro-container virtualization";
|
|
|
|
homepage = http://firecracker-microvm.io;
|
|
|
|
license = licenses.asl20;
|
2019-10-29 01:43:21 +01:00
|
|
|
platforms = [ "x86_64-linux" "aarch64-linux" ];
|
2018-11-30 00:10:35 +01:00
|
|
|
maintainers = with maintainers; [ thoughtpolice ];
|
|
|
|
};
|
|
|
|
}
|