tpwrules / nixos-apple-silicon

Resources to install NixOS bare metal on Apple Silicon Macs
MIT License
893 stars 92 forks source link

Add muvm to nixpkgs #251

Open bruhderek opened 1 day ago

bruhderek commented 1 day ago

Hey I would appreciate it if muvm was added to nixpkgs... I got it working with this config:

{
  pkgs,
  lib,
  rustPlatform,
  fetchFromGitHub,
}:
let
  libkrun-muvm = pkgs.libkrun.overrideAttrs (old: {
    makeFlags = (old.makeFlags or [ ]) ++ [ "BLK=1" ];
  });
in
rustPlatform.buildRustPackage rec {
  pname = "muvm";
  version = "0.1.3";

  src = fetchFromGitHub {
    owner = "AsahiLinux";
    repo = "muvm";
    rev = "muvm-${version}";
    hash = "sha256-K/Yhc/qYUhMlIOPF37O5n+60uSb1+vUJvYLH+WOjph0=";
  };

  cargoHash = "sha256-waaEnkJo47E/nvTphW1nGBjwZ8/iG3MtdbegPjp8VM4=";

  buildInputs = [
    libkrun-muvm
  ];

  nativeBuildInputs = [
    rustPlatform.bindgenHook
  ];

  meta = {
    description = "Muvm - run programs from your system in a microVM";
    homepage = "https://github.com/AsahiLinux/muvm";
    license = lib.licenses.unfree; # FIXME: nix-init did not find a license
    maintainers = with lib.maintainers; [ ];
    mainProgram = "muvm";
  };
}
flokli commented 10 hours ago

@bruhderek can you open a (draft) PR in nixpkgs? That'd probably be the right place to have this - we also moved some somewhat asahi-specific packages to there, like speakersafetyd, and it's definitely easier to give feedback too.