2021-01-11 07:54:33 +00:00
|
|
|
{ fetchurl, lib, stdenv }:
|
2018-11-29 23:10:35 +00:00
|
|
|
|
|
|
|
let
|
2022-01-22 03:38:58 +00:00
|
|
|
version = "0.25.2";
|
2018-11-29 23:10:35 +00:00
|
|
|
|
2019-10-29 00:43:21 +00:00
|
|
|
suffix = {
|
2021-07-15 22:53:45 +00:00
|
|
|
x86_64-linux = "x86_64";
|
2020-02-02 02:52:48 +00:00
|
|
|
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";
|
|
|
|
|
2021-04-15 17:50:29 +00:00
|
|
|
dlbin = sha256: fetchurl {
|
2021-07-15 22:53:45 +00:00
|
|
|
url = "${baseurl}/v${version}/firecracker-v${version}-${suffix}.tgz";
|
2021-04-15 17:50:29 +00:00
|
|
|
sha256 = sha256."${stdenv.hostPlatform.system}";
|
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;
|
2019-10-29 00:36:14 +00:00
|
|
|
|
2021-04-15 17:50:29 +00:00
|
|
|
sourceRoot = ".";
|
|
|
|
src = dlbin {
|
2022-01-22 03:38:58 +00:00
|
|
|
x86_64-linux = "sha256-ZzlPq+Q9XfWQJr+7nKS0e6bfKwYNfpMHSiBIKeOr/s4=";
|
|
|
|
aarch64-linux = "sha256-75UC+HeVUfUk1HRvTJsOHbHHkgr6me1OtxDF7lahf68=";
|
2021-04-15 17:50:29 +00:00
|
|
|
};
|
|
|
|
|
2021-07-20 08:48:48 +00:00
|
|
|
dontConfigure = true;
|
2019-10-29 00:36:14 +00:00
|
|
|
|
2021-07-15 22:53:45 +00:00
|
|
|
buildPhase = ''
|
2022-01-22 03:38:58 +00:00
|
|
|
mv release-v${version}-${suffix}/firecracker-v${version}-${suffix} firecracker
|
|
|
|
mv release-v${version}-${suffix}/jailer-v${version}-${suffix} jailer
|
2019-10-29 00:36:14 +00:00
|
|
|
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
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-11-29 23:10:35 +00:00
|
|
|
description = "Secure, fast, minimal micro-container virtualization";
|
2021-07-15 22:53:45 +00:00
|
|
|
homepage = "http://firecracker-microvm.io";
|
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = [ "x86_64-linux" "aarch64-linux" ];
|
|
|
|
maintainers = with maintainers; [ thoughtpolice endocrimes ];
|
2018-11-29 23:10:35 +00:00
|
|
|
};
|
|
|
|
}
|