2021-01-15 22:18:51 +00:00
|
|
|
{ fetchurl, lib, stdenv }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2022-08-21 13:32:41 +00:00
|
|
|
version = "1.1.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
suffix = {
|
2021-08-05 21:33:18 +00:00
|
|
|
x86_64-linux = "x86_64";
|
2020-04-24 23:36:52 +00:00
|
|
|
aarch64-linux = "aarch64";
|
|
|
|
}."${stdenv.hostPlatform.system}" or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
|
|
|
|
|
|
|
baseurl = "https://github.com/firecracker-microvm/firecracker/releases/download";
|
|
|
|
|
2021-04-17 00:35:05 +00:00
|
|
|
dlbin = sha256: fetchurl {
|
2021-08-05 21:33:18 +00:00
|
|
|
url = "${baseurl}/v${version}/firecracker-v${version}-${suffix}.tgz";
|
2021-04-17 00:35:05 +00:00
|
|
|
sha256 = sha256."${stdenv.hostPlatform.system}";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "firecracker";
|
|
|
|
inherit version;
|
|
|
|
|
2021-04-17 00:35:05 +00:00
|
|
|
sourceRoot = ".";
|
|
|
|
src = dlbin {
|
2022-08-21 13:32:41 +00:00
|
|
|
x86_64-linux = "sha256-KRlOE4iDWMYzKZUZnuKIwIGooj5o8ARpROS7f2VIr1c=";
|
|
|
|
aarch64-linux = "sha256-AqVFqUbMtjPmOsSgAaJ2AFNc0McC708fAD36qLz0VAc=";
|
2021-04-17 00:35:05 +00:00
|
|
|
};
|
|
|
|
|
2021-07-21 07:28:18 +00:00
|
|
|
dontConfigure = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
buildPhase = ''
|
2022-01-23 02:10:13 +00:00
|
|
|
mv release-v${version}-${suffix}/firecracker-v${version}-${suffix} firecracker
|
|
|
|
mv release-v${version}-${suffix}/jailer-v${version}-${suffix} jailer
|
2020-04-24 23:36:52 +00:00
|
|
|
chmod +x firecracker jailer
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
checkPhase = ''
|
|
|
|
./firecracker --version
|
|
|
|
./jailer --version
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
install -D firecracker $out/bin/firecracker
|
|
|
|
install -D jailer $out/bin/jailer
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Secure, fast, minimal micro-container virtualization";
|
2021-08-05 21:33:18 +00:00
|
|
|
homepage = "http://firecracker-microvm.io";
|
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = [ "x86_64-linux" "aarch64-linux" ];
|
|
|
|
maintainers = with maintainers; [ thoughtpolice endocrimes ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|