Merge pull request #186418 from NickCao/krunvm

authored by Franz Pletz and committed by GitHub f8334115 33ad9bea

+148
+42
pkgs/applications/virtualization/krunvm/default.nix
··· 1 + { lib 2 + , stdenv 3 + , rustPlatform 4 + , fetchFromGitHub 5 + , asciidoctor 6 + , libkrun 7 + }: 8 + 9 + stdenv.mkDerivation rec { 10 + pname = "krunvm"; 11 + version = "0.2.1"; 12 + 13 + src = fetchFromGitHub { 14 + owner = "containers"; 15 + repo = pname; 16 + rev = "v${version}"; 17 + sha256 = "sha256-rR762L8P+7ebE0u4MVCJoXc5mmqXlDFfSas+lFBMVFQ="; 18 + }; 19 + 20 + cargoDeps = rustPlatform.fetchCargoTarball { 21 + inherit src; 22 + hash = "sha256-3WiXm90XiQHpCbhlkigg/ZATQeDdUKTstN7hwcsKm4o="; 23 + }; 24 + 25 + nativeBuildInputs = with rustPlatform;[ 26 + cargoSetupHook 27 + rust.cargo 28 + rust.rustc 29 + asciidoctor 30 + ]; 31 + 32 + buildInputs = [ libkrun ]; 33 + 34 + makeFlags = [ "PREFIX=${placeholder "out"}" ]; 35 + 36 + meta = with lib; { 37 + description = "A CLI-based utility for creating microVMs from OCI images"; 38 + homepage = "https://github.com/containers/krunvm"; 39 + license = licenses.asl20; 40 + maintainers = with maintainers; [ nickcao ]; 41 + }; 42 + }
+49
pkgs/development/libraries/libkrun/default.nix
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rustPlatform 5 + , pkg-config 6 + , glibc 7 + , openssl 8 + , libkrunfw 9 + , sevVariant ? false 10 + }: 11 + 12 + stdenv.mkDerivation rec { 13 + pname = "libkrun"; 14 + version = "1.3.0"; 15 + 16 + src = fetchFromGitHub { 17 + owner = "containers"; 18 + repo = pname; 19 + rev = "v${version}"; 20 + hash = "sha256-qVyEqiqaQ8wfZhL5u+Bsaa1yXlgHUitSj5bo7FJ5Y8c="; 21 + }; 22 + 23 + cargoDeps = rustPlatform.fetchCargoTarball { 24 + inherit src; 25 + hash = "sha256-jxSzhj1iU8qY+sZEVCYTaUqpaA4egjJi9qxrapASQF0="; 26 + }; 27 + 28 + nativeBuildInputs = with rustPlatform;[ 29 + cargoSetupHook 30 + rust.cargo 31 + rust.rustc 32 + ] ++ lib.optional sevVariant pkg-config; 33 + 34 + buildInputs = [ 35 + glibc 36 + glibc.static 37 + (libkrunfw.override { inherit sevVariant; }) 38 + ] ++ lib.optional sevVariant openssl; 39 + 40 + makeFlags = [ "PREFIX=${placeholder "out"}" ] 41 + ++ lib.optional sevVariant "SEV=1"; 42 + 43 + meta = with lib; { 44 + description = "A dynamic library providing Virtualization-based process isolation capabilities"; 45 + homepage = "https://github.com/containers/libkrun"; 46 + license = licenses.asl20; 47 + maintainers = with maintainers; [ nickcao ]; 48 + }; 49 + }
+49
pkgs/development/libraries/libkrunfw/default.nix
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , fetchurl 5 + , flex 6 + , bison 7 + , bc 8 + , elfutils 9 + , python3 10 + , sevVariant ? false 11 + }: 12 + 13 + assert sevVariant -> stdenv.isx86_64; 14 + stdenv.mkDerivation rec { 15 + pname = "libkrunfw"; 16 + version = "3.3.0"; 17 + 18 + src = fetchFromGitHub { 19 + owner = "containers"; 20 + repo = pname; 21 + rev = "v${version}"; 22 + hash = "sha256-ay+E5AgJeA0i3T4JDosDawwtezDGquzAvYEWHGbPidg="; 23 + }; 24 + 25 + kernelSrc = fetchurl { 26 + url = "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.59.tar.xz"; 27 + hash = "sha256-5t3GQgVzQNsGs7khwrMb/tLGETWejxRMPlz5w6wzvMs="; 28 + }; 29 + 30 + preBuild = '' 31 + substituteInPlace Makefile --replace 'curl $(KERNEL_REMOTE) -o $(KERNEL_TARBALL)' 'ln -s $(kernelSrc) $(KERNEL_TARBALL)' 32 + ''; 33 + 34 + nativeBuildInputs = [ flex bison bc python3 python3.pkgs.pyelftools ]; 35 + buildInputs = [ elfutils ]; 36 + 37 + makeFlags = [ "PREFIX=${placeholder "out"}" ] 38 + ++ lib.optional sevVariant "SEV=1"; 39 + 40 + enableParallelBuilding = true; 41 + 42 + meta = with lib; { 43 + description = "A dynamic library bundling the guest payload consumed by libkrun"; 44 + homepage = "https://github.com/containers/libkrunfw"; 45 + license = with licenses; [ lgpl2Only lgpl21Only ]; 46 + maintainers = with maintainers; [ nickcao ]; 47 + platforms = [ "x86_64-linux" "aarch64-linux" ]; 48 + }; 49 + }
+8
pkgs/top-level/all-packages.nix
··· 7859 7859 7860 7860 krunner-pass = libsForQt5.callPackage ../tools/security/krunner-pass { }; 7861 7861 7862 + krunvm = callPackage ../applications/virtualization/krunvm { }; 7863 + 7862 7864 kronometer = libsForQt5.callPackage ../tools/misc/kronometer { }; 7863 7865 7864 7866 krop = callPackage ../applications/graphics/krop { }; ··· 23878 23880 libatasmart = callPackage ../os-specific/linux/libatasmart { }; 23879 23881 23880 23882 libcgroup = callPackage ../os-specific/linux/libcgroup { }; 23883 + 23884 + libkrun = callPackage ../development/libraries/libkrun { }; 23885 + 23886 + libkrun-sev = callPackage ../development/libraries/libkrun { sevVariant = true; }; 23887 + 23888 + libkrunfw = callPackage ../development/libraries/libkrunfw { }; 23881 23889 23882 23890 libnl = callPackage ../os-specific/linux/libnl { }; 23883 23891