felix86: init at 26.04

This commit is contained in:
eljamm
2026-04-03 12:36:57 +02:00
parent 5b2c2d8434
commit 5121c4b022
2 changed files with 101 additions and 0 deletions
+66
View File
@@ -0,0 +1,66 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
pkg-config,
libGL,
libx11,
vulkan-headers,
vulkan-loader,
callPackage,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "felix86";
version = "26.04";
src = fetchFromGitHub {
owner = "OFFTKP";
repo = "felix86";
tag = finalAttrs.version;
hash = "sha256-onhPibvO74yo95zop7EhG+EILn4M70X9ivhS9I+fIBY=";
};
strictDeps = true;
nativeBuildInputs = [
cmake
pkg-config
vulkan-headers
];
buildInputs = [
libGL
libx11
vulkan-loader
];
installPhase = ''
runHook preInstall
install -Dm755 felix86 $out/bin/felix86
runHook postInstall
'';
cmakeFlags = [
(lib.cmakeBool "ZYDIS_BUILD_DOXYGEN" false)
(lib.cmakeBool "BUILD_TESTS" true)
];
passthru.tests = callPackage ./test.nix { };
meta = {
description = "x86 and x86-64 userspace emulator for RISC-V Linux";
homepage = "https://github.com/OFFTKP/felix86";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ eljamm ];
teams = with lib.teams; [ ngi ];
mainProgram = "felix86";
platforms = [ "riscv64-linux" ];
};
})
+35
View File
@@ -0,0 +1,35 @@
{
pkgs,
...
}:
pkgs.testers.nixosTest {
name = "felix86";
nodes.machine =
{
config,
pkgs,
...
}:
{
boot.binfmt.emulatedSystems = [ "riscv64-linux" ];
environment.systemPackages = [
pkgs.pkgsCross.riscv64.felix86
];
};
testScript =
# python
''
machine.wait_for_unit("multi-user.target")
machine.succeed("felix86 --help")
'';
interactive.nodes.machine = {
virtualisation.graphics = false;
environment.systemPackages = [ pkgs.binutils ];
};
interactive.sshBackdoor.enable = true;
}