2018-11-30 00:10:35 +01:00
|
|
|
{ fetchurl, stdenv }:
|
|
|
|
|
|
|
|
let
|
2020-05-09 16:13:06 +02:00
|
|
|
version = "0.21.1";
|
2018-11-30 00:10:35 +01:00
|
|
|
|
2019-10-29 01:43:21 +01:00
|
|
|
suffix = {
|
2020-02-02 03:52:48 +01:00
|
|
|
x86_64-linux = "x86_64";
|
|
|
|
aarch64-linux = "aarch64";
|
2019-10-29 01:43:21 +01:00
|
|
|
}."${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 {
|
2020-02-02 03:52:48 +01:00
|
|
|
url = "${baseurl}/v${version}/${name}-v${version}-${suffix}";
|
2019-10-29 01:43:21 +01:00
|
|
|
sha256 = sha256."${stdenv.hostPlatform.system}";
|
|
|
|
};
|
|
|
|
|
|
|
|
firecracker-bin = fetchbin "firecracker" {
|
2020-05-09 16:13:06 +02:00
|
|
|
x86_64-linux = "0g4fja3bz1fsyz8vj99199yblkn46ygf33ldwd1ssw8f957vbwnb";
|
|
|
|
aarch64-linux = "1qyppcxnh7f42fs4px5rvkk6lza57h2sq9naskvqn5zy4vsvq89s";
|
2019-10-29 01:43:21 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
jailer-bin = fetchbin "jailer" {
|
2020-05-09 16:13:06 +02:00
|
|
|
x86_64-linux = "0x89pfmqci9d3i9fi9b9zm94yr2v7pq7kp3drlb952jkdfj0njyk";
|
|
|
|
aarch64-linux = "03fx9sk88jm23wqm8fraqd1ccfhbqvc310mkfv1f5p2ykhq2ahrk";
|
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";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://firecracker-microvm.io";
|
2018-11-30 00:10:35 +01:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|