Skip to content

Instantly share code, notes, and snippets.

View KitsuneDev's full-sized avatar
🖥️
Working on iOS Apps

Luna KitsuneDev

🖥️
Working on iOS Apps
View GitHub Profile
@jchv
jchv / configuration.nix
Last active February 14, 2023 05:22
Nix configuration for VGA passthrough
{ config, pkgs, lib, ... }:
{
# IOMMU configuration
boot.kernelParams = [ "amd_iommu=on" "pcie_aspm=off" ];
boot.kernelModules = [ "kvm-amd" "vfio_virqfd" "vfio_pci" "vfio_iommu_type1" "vfio" ];
boot.extraModprobeConfig = ''
options vfio-pci ids=10de:13c2,10de:0fbb
options kvm ignore_msrs=1
'';
private static void RewriteAssembly(string assemblyPath)
{
ModuleDef assembly = ModuleDefMD.Load(assemblyPath);
foreach (TypeDef type in assembly.Types.SelectMany(t => t.NestedTypes.Concat(t)))
{
type.Attributes &= ~TypeAttributes.VisibilityMask;
if (type.IsNested)
{