From b942e78a577a478f76c818a1c5848a56c6f0b546 Mon Sep 17 00:00:00 2001 From: Jasi Date: Sat, 20 Dec 2025 19:44:02 -0500 Subject: [PATCH 1/3] muvm: 0.4.1 -> 0.5.0 --- pkgs/by-name/mu/muvm/package.nix | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/pkgs/by-name/mu/muvm/package.nix b/pkgs/by-name/mu/muvm/package.nix index fafd024a3b0e..d4e277033e87 100644 --- a/pkgs/by-name/mu/muvm/package.nix +++ b/pkgs/by-name/mu/muvm/package.nix @@ -9,11 +9,11 @@ systemd, udev, pkg-config, - procps, fex, writeShellApplication, coreutils, makeBinaryWrapper, + nix-update-script, # TODO: Enable again when sommelier is not broken. # For now, don't give false impression of sommelier being supported. # sommelier, @@ -50,25 +50,22 @@ let "--execute-pre=${lib.getExe initScript}" ]; in -rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage (finalAttrs: { pname = "muvm"; - version = "0.4.1"; + version = "0.5.0"; src = fetchFromGitHub { owner = "AsahiLinux"; repo = "muvm"; - rev = "muvm-${version}"; - hash = "sha256-1XPhVEj7iqTxdWyYwNk6cbb9VRGuhpvvowYDPJb1cWU="; + tag = "muvm-${finalAttrs.version}"; + hash = "sha256-k3Jj/Tzu5ZfnADMiVG7pAPqosrkZvhmehi0NMbyudN0="; }; - cargoHash = "sha256-fkvdS0c1Ib8Kto44ou06leXy731cpMHXevyFR5RROt4="; + cargoHash = "sha256-jFNyQD2Hf1K5+wHDRD2WG70IJfZbL+hT/gtjeUnt5Mk="; postPatch = '' substituteInPlace crates/muvm/src/guest/bin/muvm-guest.rs \ --replace-fail "/usr/lib/systemd/systemd-udevd" "${systemd}/lib/systemd/systemd-udevd" - - substituteInPlace crates/muvm/src/monitor.rs \ - --replace-fail "/sbin/sysctl" "${lib.getExe' procps "sysctl"}" '' # Only patch FEX path if we're aarch64, otherwise we don't want the derivation to pull in FEX in any way + lib.optionalString stdenv.hostPlatform.isAarch64 '' @@ -95,6 +92,10 @@ rustPlatform.buildRustPackage rec { wrapProgram $out/bin/muvm ${wrapArgs} ''; + passthru = { + updateScript = nix-update-script { }; + }; + meta = { description = "Run programs from your system in a microVM"; homepage = "https://github.com/AsahiLinux/muvm"; @@ -106,4 +107,4 @@ rustPlatform.buildRustPackage rec { inherit (libkrun.meta) platforms; mainProgram = "muvm"; }; -} +}) From 4067b99a991ceecd790ae2641182f115f0265168 Mon Sep 17 00:00:00 2001 From: Jasi Date: Sat, 20 Dec 2025 20:13:04 -0500 Subject: [PATCH 2/3] muvm: remove sommelier option entirely DRM native context for asahi has been merged into virglrenderer 1.2.0, so keeping sommelier is no longer useful. --- pkgs/by-name/mu/muvm/package.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pkgs/by-name/mu/muvm/package.nix b/pkgs/by-name/mu/muvm/package.nix index d4e277033e87..44a8fb3e3c37 100644 --- a/pkgs/by-name/mu/muvm/package.nix +++ b/pkgs/by-name/mu/muvm/package.nix @@ -14,10 +14,6 @@ coreutils, makeBinaryWrapper, nix-update-script, -# TODO: Enable again when sommelier is not broken. -# For now, don't give false impression of sommelier being supported. -# sommelier, -# withSommelier ? false, }: let # TODO: Setup setuid wrappers. From d1a0237f789632fe9cdd4f9b9268d0741ce0cf86 Mon Sep 17 00:00:00 2001 From: Jasi Date: Sat, 20 Dec 2025 20:15:33 -0500 Subject: [PATCH 3/3] muvm: simplify wrapper code --- pkgs/by-name/mu/muvm/package.nix | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/pkgs/by-name/mu/muvm/package.nix b/pkgs/by-name/mu/muvm/package.nix index 44a8fb3e3c37..09e92b4bdee4 100644 --- a/pkgs/by-name/mu/muvm/package.nix +++ b/pkgs/by-name/mu/muvm/package.nix @@ -24,24 +24,26 @@ let coreutils ]; text = '' - if [[ ! -f /etc/NIXOS ]]; then exit; fi - - ln -s /run/muvm-host/run/current-system /run/current-system - # Only create the symlink if that path exists on the host and is a directory. - if [[ -d /run/muvm-host/run/opengl-driver ]]; then ln -s /run/muvm-host/run/opengl-driver /run/opengl-driver; fi + if [[ -f /etc/NIXOS ]]; then + ln -s /run/muvm-host/run/current-system /run/current-system + if [[ -d /run/muvm-host/run/opengl-driver ]]; then + ln -s /run/muvm-host/run/opengl-driver /run/opengl-driver + fi + fi ''; }; - binPath = [ - dhcpcd - passt - (placeholder "out") - ] - ++ lib.optionals stdenv.hostPlatform.isAarch64 [ fex ]; wrapArgs = lib.escapeShellArgs [ "--prefix" "PATH" ":" - (lib.makeBinPath binPath) + (lib.makeBinPath ( + [ + dhcpcd + passt + (placeholder "out") + ] + ++ lib.optionals stdenv.hostPlatform.isAarch64 [ fex ] + )) "--add-flags" "--execute-pre=${lib.getExe initScript}" ];