2024-08-09 03:30:29 +01:00
|
|
|
{
|
|
|
|
fetchurl,
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
}:
|
2018-11-29 23:10:35 +00:00
|
|
|
|
|
|
|
let
|
2024-09-05 13:08:15 +01:00
|
|
|
version = "1.9.0";
|
2022-11-26 05:45:49 +00:00
|
|
|
# nixpkgs-update: no auto update
|
2018-11-29 23:10:35 +00:00
|
|
|
|
2024-08-09 03:30:29 +01:00
|
|
|
suffix =
|
|
|
|
{
|
|
|
|
x86_64-linux = "x86_64";
|
|
|
|
aarch64-linux = "aarch64";
|
|
|
|
}
|
|
|
|
."${stdenv.hostPlatform.system}" or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
2019-10-29 00:43:21 +00:00
|
|
|
|
|
|
|
baseurl = "https://github.com/firecracker-microvm/firecracker/releases/download";
|
|
|
|
|
2024-08-09 03:30:29 +01:00
|
|
|
dlbin =
|
|
|
|
hash:
|
|
|
|
fetchurl {
|
|
|
|
url = "${baseurl}/v${version}/firecracker-v${version}-${suffix}.tgz";
|
|
|
|
hash =
|
|
|
|
hash."${stdenv.hostPlatform.system}" or (throw "unsupported system ${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 18:50:29 +01:00
|
|
|
sourceRoot = ".";
|
|
|
|
src = dlbin {
|
2024-09-05 13:08:15 +01:00
|
|
|
x86_64-linux = "sha256-lcE3QMfKGm37QOD1HNCp7v7h8iPNLDU4dV0Dw6m6Ujc=";
|
|
|
|
aarch64-linux = "sha256-xVZOdt7CuOgJLFLw+KTF9FzzF5HpWpMC9DYKdx33j2k=";
|
2021-04-15 18:50:29 +01:00
|
|
|
};
|
|
|
|
|
2021-07-20 09:48:48 +01:00
|
|
|
dontConfigure = true;
|
2019-10-29 00:36:14 +00:00
|
|
|
|
2021-07-15 23:53:45 +01: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 23:53:45 +01:00
|
|
|
homepage = "http://firecracker-microvm.io";
|
2023-09-16 14:00:28 +01:00
|
|
|
changelog = "https://github.com/firecracker-microvm/firecracker/releases/tag/v${version}";
|
|
|
|
mainProgram = "firecracker";
|
2021-07-15 23:53:45 +01:00
|
|
|
license = licenses.asl20;
|
2024-08-09 03:30:29 +01:00
|
|
|
platforms = [
|
|
|
|
"x86_64-linux"
|
|
|
|
"aarch64-linux"
|
|
|
|
];
|
|
|
|
maintainers = with maintainers; [
|
|
|
|
thoughtpolice
|
|
|
|
qjoly
|
2024-08-09 03:32:52 +01:00
|
|
|
techknowlogick
|
2024-08-09 03:30:29 +01:00
|
|
|
];
|
2018-11-29 23:10:35 +00:00
|
|
|
};
|
|
|
|
}
|