diff --git a/common/home/packages/games.nix b/common/home/packages/games.nix index d6239d3..2bfc6ef 100644 --- a/common/home/packages/games.nix +++ b/common/home/packages/games.nix @@ -15,6 +15,7 @@ gzdoom openrct2 r2modman + gale ruffle (lutris.override { diff --git a/common/home/packages/repair.nix b/common/home/packages/repair.nix index 69bd076..5af879c 100644 --- a/common/home/packages/repair.nix +++ b/common/home/packages/repair.nix @@ -24,6 +24,8 @@ kitty-img kitty-themes v4l-utils + okteta + rar ]; in { packages = unstable; diff --git a/common/nixos/default-config.nix b/common/nixos/default-config.nix index ff1a03e..428fc75 100644 --- a/common/nixos/default-config.nix +++ b/common/nixos/default-config.nix @@ -56,14 +56,6 @@ vendor-reset ]; - # https://wiki.nixos.org/wiki/OSX-KVM - extraModprobeConfig = '' - options kvm_intel nested=1 - options kvm_intel emulate_invalid_guest_state=0 - options kvm ignore_msrs=1 - options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1 - ''; - kernelParams = [ "psi=1" # Enable PSI to make sure that Binder doesn't die when using Waydroid. ]; diff --git a/nixos/custom-odin-nixos/configuration.nix b/nixos/custom-odin-nixos/configuration.nix index c3bc494..6355bb4 100755 --- a/nixos/custom-odin-nixos/configuration.nix +++ b/nixos/custom-odin-nixos/configuration.nix @@ -2,9 +2,16 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running 'nixos-help'). -{ config, pkgs, ... }: let +{ config, pkgs, lib, ... }: let # TODO: Check if this exists and is the right display. virtualDisplayId = "HDMI-A-1"; + + vfio-pci-ids = [ + "10de:1f08" + "10de:10f9" + "10de:1ada" + "10de:1adb" + ]; in { imports = [ ./hardware-configuration.nix # Include the results of the hardware scan. @@ -33,12 +40,25 @@ in { plymouth.enable = true; + # https://wiki.nixos.org/wiki/OSX-KVM + extraModprobeConfig = '' + options kvm_amd nested=1 + options kvm_amd emulate_invalid_guest_state=0 + options kvm ignore_msrs=1 + options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1 + blacklist nouveau + options nouveau modeset=0 + options kvmfr static_size_mb=64 + ''; + kernelParams = [ "psi=1" # Enable PSI to make sure that Binder doesn't die when using Waydroid. # "drm_kms_helper.edid_firmware=${virtualDisplayId}:edid/reboots-virtual-display.bin" # Set the custom EDID file to the virtual display interface. + ("vfio-pci.ids=" + lib.concatStringsSep "," vfio-pci-ids) ]; - kernelModules = [ "vfio" "vfio_iommu_type1" "vfio_pci" "vfio_virqfd" ]; + kernelModules = [ "kvm-amd" "kvmfr" "vfio" "vfio_iommu_type1" "vfio_pci" "vfio_virqfd" ]; + blacklistedKernelModules = [ "nouveau" "nvidia" "nvidia_drm" "nvidia_uvm" "nvidia_modeset" "i2c_nvidia_gpu" ]; }; powerManagement.enable = true; @@ -62,15 +82,6 @@ in { opencl.enable = true; }; - nvidia = { - modesetting.enable = true; - powerManagement.enable = false; - open = true; - powerManagement.finegrained = false; - nvidiaSettings = true; - package = config.boot.kernelPackages.nvidiaPackages.stable; - }; - opentabletdriver = { enable = true; daemon.enable = true; @@ -166,9 +177,19 @@ in { tpmSupport = true; }).fd]; }; + + verbatimConfig = '' + cgroup_device_acl = [ + "/dev/null", "/dev/full", "/dev/zero", + "/dev/random", "/dev/urandom", + "/dev/ptmx", "/dev/kvm", "/dev/kqemu", + "/dev/rtc","/dev/hpet", "/dev/vfio/vfio", + "/dev/kvmfr0" + ] + ''; }; - hooks.qemu = let + hooks.qemu = let windows-vm-name = "gayming"; in { "${windows-vm-name}" = pkgs.writeShellScript windows-vm-name '' @@ -340,10 +361,16 @@ in { libinput.enable = true; pcscd.enable = true; - udev.packages = with pkgs; [ - qmk-udev-rules - android-udev-rules - ]; + udev = { + packages = with pkgs; [ + qmk-udev-rules + android-udev-rules + ]; + + extraRules = '' + SUBSYSTEM=="kvmfr", OWNER="reboot", GROUP="kvm", MODE="0660" + ''; + }; ratbagd.enable = true; k3s.enable = true; diff --git a/nixos/custom-odin-nixos/hardware-configuration.nix b/nixos/custom-odin-nixos/hardware-configuration.nix index 4699183..bf34748 100755 --- a/nixos/custom-odin-nixos/hardware-configuration.nix +++ b/nixos/custom-odin-nixos/hardware-configuration.nix @@ -8,7 +8,6 @@ boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "thunderbolt" "usb_storage" "usbhid" "sd_mod" "vmd" "nvme" "uas" "rtsx_pci_sdmmc" ]; boot.initrd.kernelModules = [ "dm-snapshot" ]; - boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; fileSystems."/" = @@ -40,6 +39,12 @@ fsType = "btrfs"; options = [ "subvol=swap,noatime" ]; }; + + #fileSystems."/dev/pts" = { + # fsType = "devpts"; + # device = "devpts"; + # options = [ "gid=5,mode=620" ]; + #}; swapDevices = [ { device = "/swap/swapfile"; } diff --git a/nixos/temp-installer-nixos/configuration.nix b/nixos/temp-installer-nixos/configuration.nix index 57d27b1..dc524f3 100644 --- a/nixos/temp-installer-nixos/configuration.nix +++ b/nixos/temp-installer-nixos/configuration.nix @@ -1,8 +1,9 @@ -{ pkgs, modulesPath, hostConfig, ... }: { +{ config, pkgs, modulesPath, hostConfig, lib, ... }: { imports = [ (modulesPath + "/installer/cd-dvd/installation-cd-base.nix") ]; users.users."${hostConfig.username}".password = "password"; boot.plymouth.enable = true; + boot.kernelPackages = lib.mkForce config.boot.zfs.package.latestCompatibleLinuxPackages; hardware = { graphics = { @@ -13,20 +14,20 @@ intel-media-driver # LIBVA_DRIVER_NAME=iHD intel-vaapi-driver # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium) libvdpau-va-gl - mesa.drivers + mesa intel-media-sdk vpl-gpu-rt ]; }; - #nvidia = { - # modesetting.enable = true; - # powerManagement.enable = false; - # open = true; - # powerManagement.finegrained = false; - # nvidiaSettings = true; - # package = config.boot.kernelPackages.nvidiaPackages.stable; - #}; + nvidia = { + modesetting.enable = true; + powerManagement.enable = false; + open = true; + powerManagement.finegrained = false; + nvidiaSettings = true; + package = config.boot.kernelPackages.nvidiaPackages.stable; + }; bluetooth = { enable = true;