depot/third_party/nixpkgs/pkgs/by-name/ka/kata-runtime/kata-images.nix

50 lines
1.5 KiB
Nix
Raw Normal View History

# Derived from https://github.com/colemickens/nixpkgs-kubernetes
{
fetchzip,
lib,
stdenv,
version,
}:
let
imageSuffix =
{
"x86_64-linux" = "amd64";
"aarch64-linux" = "arm64";
}
."${stdenv.hostPlatform.system}" or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
imageHash =
{
"x86_64-linux" = "sha256-6ySKAqrbHDRgVlI7wm2p4Uw96ZMzUpP00liujxlruSM=";
"aarch64-linux" = "sha256-pEPkDXT4OunfN2sGb8Ru05tFHaBsYUcmG5Iy7yH4kX8=";
}
."${stdenv.hostPlatform.system}" or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
in
fetchzip {
name = "kata-images-${version}";
url = "https://github.com/kata-containers/kata-containers/releases/download/${version}/kata-static-${version}-${imageSuffix}.tar.xz";
hash = imageHash;
postFetch = ''
mv $out/kata/share/kata-containers kata-containers
rm -r $out
mkdir -p $out/share
mv kata-containers $out/share/kata-containers
'';
meta = {
description = "Lightweight Virtual Machines like containers that provide the workload isolation and security of VMs";
homepage = "https://github.com/kata-containers/kata-containers";
changelog = "https://github.com/kata-containers/kata-containers/releases/tag/${version}";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ thomasjm ];
platforms = [
"x86_64-linux"
"aarch64-linux"
];
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
};
}