Skip to content

Commit

Permalink
muvm: init from krun as 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
RossComputerGuy committed Jan 23, 2025
1 parent d0f7aa7 commit b602132
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 69 deletions.
69 changes: 0 additions & 69 deletions pkgs/by-name/kr/krun/package.nix

This file was deleted.

77 changes: 77 additions & 0 deletions pkgs/by-name/mu/muvm/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
rustPlatform,
libkrun,
makeWrapper,
passt,
dhcpcd,
sommelier,
systemd,
udev,
pkg-config,
withSommelier ? false,
}:

rustPlatform.buildRustPackage rec {
pname = "muvm";
version = "0.2.0";

src = fetchFromGitHub {
owner = "AsahiLinux";
repo = pname;
rev = "muvm-${version}";
hash = "sha256-eB60LjI1Qr85MPtQh0Fb5ihzBahz95tXaozNe8q6o3o=";
};

cargoHash = "sha256-ilCVALy1ofiq6Ak8nBhWusPwRAnD9VgOiOV5PKhF5GQ=";

postPatch = ''
substituteAll crates/muvm/src/guest/bin/muvm-guest.rs \
--replace-fail "/usr/lib/systemd/systemd-udevd" "${systemd}/lib/systemd/systemd-udevd"
'';

nativeBuildInputs = [
rustPlatform.bindgenHook
makeWrapper
pkg-config
];

buildInputs = [
(libkrun.override {
withBlk = true;
withGpu = true;
withNet = true;
})
udev
];

# Allow for sommelier to be disabled as it can cause problems.
wrapArgs = [
"--prefix PATH : ${
lib.makeBinPath (
lib.optional withSommelier [ sommelier ]
++ [
dhcpcd
passt
(placeholder "out")
]
)
}"
];

postFixup = ''
wrapProgram $out/bin/muvm $wrapArgs
'';

meta = {
description = "Run programs from your system in a microVM";
homepage = "https://github.com/AsahiLinux/muvm";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ RossComputerGuy ];
platforms = libkrun.meta.platforms;
mainProgram = "krun";
};
}

0 comments on commit b602132

Please sign in to comment.