Global: fix pci passtrough. Nyx: bunch of old changes

This commit is contained in:
blahai 2024-10-28 17:18:56 +02:00
parent c3dbd37098
commit 8055d2c8c1
Signed by: blahai
SSH key fingerprint: SHA256:ZfCryi+V64yG+vC1ZIIsqgvBCmA31tTi7RJ6M8CvpRc
3 changed files with 34 additions and 33 deletions

View file

@ -19,7 +19,7 @@
};
efi.canTouchEfiVariables = true;
};
kernelPackages = pkgs.linuxPackages_cachyos;
kernelPackages = pkgs.linuxPackages_zen;
kernel = {
sysctl ={
"vm.max_map_count" = 2147483642;
@ -27,13 +27,6 @@
};
};
virtualisation = {
docker = {
enable = true;
storageDriver = "btrfs";
};
};
zramSwap = {
enable = true;
algorithm = "zstd";
@ -82,19 +75,8 @@
};
};
cloudflared = {
enable = true;
};
gnome.gnome-keyring.enable = true;
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
};
hardware.pulseaudio.enable = false;
@ -103,7 +85,7 @@
users.users.pingu = {
isNormalUser = true;
description = "Elissa";
extraGroups = [ "networkmanager" "wheel" "docker" ];
extraGroups = [ "networkmanager" "wheel" "input" "render" ];
shell = pkgs.fish;
packages = with pkgs; [
floorp
@ -192,12 +174,16 @@
};
};
qt.enable = true;
environment.systemPackages = with pkgs; [
age
ssh-to-age
sops
cloudflared
inputs.zen-browser.packages."${pkgs.system}".specific
cava
socat
btrfs-progs
btop
hyprcursor
@ -243,6 +229,8 @@
material-design-icons
material-symbols
imagemagick
wireguard-tools
mission-center
];
fonts.packages = with pkgs; [

View file

@ -9,8 +9,8 @@
];
boot.initrd.availableKernelModules = [ "nvme" "ahci" "xhci_pci" "usbhid" "hid_generic" "uas" "sd_mod" ];
boot.initrd.kernelModules = [ "amdgpu" ];
boot.kernelModules = [ "kvm-amd" "amd-pstate" "amdgpu" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" "amd-pstate" ];
boot.extraModulePackages = [ ];
fileSystems."/" =

View file

@ -1,12 +1,23 @@
{ pkgs, lib, config, ... }:
let
platform = "amd";
vfioIds = [ "" "" ];
in {
{
boot = {
kernelModules = [ "kvm-${platform}" "vfio_virqfd" "vfio_pci" "vfio_iommu_type1" "vfio" ];
kernelParams = [ "${platform}_iommu=on" "${platform}_iommu=pt" "kvm.ignore_msrs=1" ];
extraModprobeConfig = "options vfio-pci ids=${builtins.concatStringsSep "," vfioIds}";
initrd.kernelModules = lib.mkBefore [
"kvm-amd"
"vfio_pci"
"vfio_iommu_type1"
"vfio"
"amdgpu"
];
kernelParams = [
"amd_iommu=on"
"amd_iommu=pt"
"kvm.ignore_msrs=1"
"vfio-pci.ids=1002:67df,1002:aaf0"
];
extraModprobeConfig = ''
softdep drm pre: vfio-pci
'';
};
virtualisation = {
@ -14,18 +25,20 @@ in {
enable = true;
onBoot = "ignore";
onShutdown = "shutdown";
};
qemu = {
package = pkgs.qemu_kvm;
ovmf.enable = true;
};
};
docker = {
enable = true;
};
};
users.users.pingu.extraGroups = [ "qemu-libvirtd" "libvirtd" "disk" "kvm" "docker" ];
environment.systemPackages = with pkgs; [
virt-manager
];