2021-01-15 22:18:51 +00:00
|
|
|
{ fetchurl, lib, stdenv }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2023-08-04 22:07:22 +00:00
|
|
|
version = "1.4.0";
|
2022-11-27 09:42:12 +00:00
|
|
|
# nixpkgs-update: no auto update
|
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 {
|
2023-08-04 22:07:22 +00:00
|
|
|
x86_64-linux = "sha256-WSa8fd0OSPo1HFkH6i8cGMNH1df88xI6PCx39ONb73c=";
|
|
|
|
aarch64-linux = "sha256-eOsO/nbwKT50tC5g6INPELh2yVb5C3EGqNLQLT7IGBs=";
|
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
|
|
|
};
|
|
|
|
}
|