mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-19 04:03:56 +00:00
6fc6e325e6
Updated firecracker to v0.24.4. This required updating the buildPhase to point to new compilation result paths. Formatting changes were performed by `nix-update --format`
57 lines
1.5 KiB
Nix
57 lines
1.5 KiB
Nix
{ fetchurl, lib, stdenv }:
|
|
|
|
let
|
|
version = "0.24.4";
|
|
|
|
suffix = {
|
|
x86_64-linux = "x86_64";
|
|
aarch64-linux = "aarch64";
|
|
}."${stdenv.hostPlatform.system}" or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
|
|
|
baseurl = "https://github.com/firecracker-microvm/firecracker/releases/download";
|
|
|
|
dlbin = sha256: fetchurl {
|
|
url = "${baseurl}/v${version}/firecracker-v${version}-${suffix}.tgz";
|
|
sha256 = sha256."${stdenv.hostPlatform.system}";
|
|
};
|
|
|
|
in
|
|
stdenv.mkDerivation {
|
|
pname = "firecracker";
|
|
inherit version;
|
|
|
|
sourceRoot = ".";
|
|
src = dlbin {
|
|
x86_64-linux = "sha256-EKndfLdkxn+S+2ElAyQ+mKEo5XN6kqZLuLCsQf+fKuk=";
|
|
aarch64-linux = "0zzr8x776aya6f6pw0dc0a6jxgbqv3f37p1vd8mmlsdv66c4kmfb";
|
|
};
|
|
|
|
configurePhase = ":";
|
|
|
|
buildPhase = ''
|
|
mv release-v${version}/firecracker-v${version}-${suffix} firecracker
|
|
mv release-v${version}/jailer-v${version}-${suffix} jailer
|
|
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
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Secure, fast, minimal micro-container virtualization";
|
|
homepage = "http://firecracker-microvm.io";
|
|
license = licenses.asl20;
|
|
platforms = [ "x86_64-linux" "aarch64-linux" ];
|
|
maintainers = with maintainers; [ thoughtpolice endocrimes ];
|
|
};
|
|
}
|