2018-11-29 23:10:35 +00:00
|
|
|
{ fetchurl, stdenv }:
|
|
|
|
|
|
|
|
let
|
2020-11-16 03:28:23 +00:00
|
|
|
version = "0.23.0";
|
2018-11-29 23:10:35 +00:00
|
|
|
|
2019-10-29 00:43:21 +00:00
|
|
|
suffix = {
|
2020-02-02 02:52:48 +00:00
|
|
|
x86_64-linux = "x86_64";
|
|
|
|
aarch64-linux = "aarch64";
|
2019-10-29 00:43:21 +00:00
|
|
|
}."${stdenv.hostPlatform.system}" or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
|
|
|
|
|
|
|
baseurl = "https://github.com/firecracker-microvm/firecracker/releases/download";
|
2018-11-29 23:10:35 +00:00
|
|
|
fetchbin = name: sha256: fetchurl {
|
2020-02-02 02:52:48 +00:00
|
|
|
url = "${baseurl}/v${version}/${name}-v${version}-${suffix}";
|
2019-10-29 00:43:21 +00:00
|
|
|
sha256 = sha256."${stdenv.hostPlatform.system}";
|
|
|
|
};
|
|
|
|
|
|
|
|
firecracker-bin = fetchbin "firecracker" {
|
2020-11-16 03:28:23 +00:00
|
|
|
x86_64-linux = "11h6qkq55y1w0mlkfkbnpxxai73rzxkiz07i747m7a9azbrmldp8";
|
|
|
|
aarch64-linux = "0zyx7md54w0fhqk1anfyjfdqrkg2mjyy17y9jk17p34yrw8j9y29";
|
2019-10-29 00:43:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
jailer-bin = fetchbin "jailer" {
|
2020-11-16 03:28:23 +00:00
|
|
|
x86_64-linux = "15slr2azqvyqlhvlh7zk1n0rkfq282kj0pllp19r0yl1w8ns1gw5";
|
|
|
|
aarch64-linux = "1d92jhd6fb7w7ciz15rcfp8jf74r2503w2fl1b6pznpc8h4qscfd";
|
2018-11-29 23:10:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
2019-10-29 00:36:14 +00:00
|
|
|
pname = "firecracker";
|
2018-11-29 23:10:35 +00:00
|
|
|
inherit version;
|
|
|
|
srcs = [ firecracker-bin jailer-bin ];
|
2019-10-29 00:36:14 +00: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-29 23:10:35 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
2019-10-29 00:36:14 +00:00
|
|
|
install -D firecracker $out/bin/firecracker
|
|
|
|
install -D jailer $out/bin/jailer
|
2018-11-29 23:10:35 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Secure, fast, minimal micro-container virtualization";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://firecracker-microvm.io";
|
2018-11-29 23:10:35 +00:00
|
|
|
license = licenses.asl20;
|
2019-10-29 00:43:21 +00:00
|
|
|
platforms = [ "x86_64-linux" "aarch64-linux" ];
|
2018-11-29 23:10:35 +00:00
|
|
|
maintainers = with maintainers; [ thoughtpolice ];
|
|
|
|
};
|
|
|
|
}
|