2018-11-29 23:10:35 +00:00
|
|
|
{ fetchurl, stdenv }:
|
|
|
|
|
|
|
|
let
|
2019-10-29 00:36:14 +00:00
|
|
|
version = "0.19.0";
|
2018-11-29 23:10:35 +00:00
|
|
|
baseurl = "https://github.com/firecracker-microvm/firecracker/releases/download";
|
|
|
|
|
|
|
|
fetchbin = name: sha256: fetchurl {
|
|
|
|
url = "${baseurl}/v${version}/${name}-v${version}";
|
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
2019-10-29 00:36:14 +00:00
|
|
|
firecracker-bin = fetchbin "firecracker" "0yjhw77xc2nc96p36jhf0va95gf6hwi9n270g4iiwakycdy048mx";
|
|
|
|
jailer-bin = fetchbin "jailer" "1q792b4bl1q3ach8nc8l0fbcil44knv3wa542xrskndzdz28lhsp";
|
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";
|
|
|
|
homepage = http://firecracker-microvm.io;
|
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
maintainers = with maintainers; [ thoughtpolice ];
|
|
|
|
};
|
|
|
|
}
|