This commit is contained in:
2025-11-30 00:32:11 +01:00
parent 1557caba8b
commit 1e6daa09f6
14 changed files with 143 additions and 765 deletions

View File

@@ -161,8 +161,28 @@
gnome-tweaks
qemu
mpv
krita
qemu
];
virtualisation.libvirtd = {
enable = true;
qemu = {
package = pkgs.qemu_kvm;
runAsRoot = true;
swtpm.enable = true;
ovmf = {
enable = true;
packages = [(pkgs.OVMF.override {
secureBoot = true;
tpmSupport = true;
}).fd];
};
};
};
systemd.tmpfiles.rules = [ "L+ /var/lib/qemu/firmware - - - - ${pkgs.qemu}/share/qemu/firmware" ];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;

View File

@@ -43,7 +43,7 @@ in
users.users.andreas = {
isNormalUser = true;
description = "Andreas Schaafsma";
extraGroups = [ "networkmanager" "wheel" ] ;
extraGroups = [ "networkmanager" "wheel" "libvirtd" ] ;
packages = with pkgs; [
# Packages from inputs
inputs.game-of-life.packages.x86_64-linux.default
@@ -64,6 +64,7 @@ in
minecraft
trilium-desktop
terraform
virt-manager
# thunderbird
];
};

View File

@@ -1,7 +1,7 @@
{ config, lib, pkgs, ... }:
{
# boot.kernelParams = [ "drm.edid_firmware=DP-1:edid/edid.bin,DP-2:edid/edid.bin,DP-3:edid/edid.bin,DP-4:edid/edid.bin" ];
boot.kernelParams = [ "drm.edid_firmware=DP-1:edid/edid.bin,DP-2:edid/edid.bin,DP-3:edid/edid.bin" ];
boot.kernelParams = [ "drm.edid_firmware=DP-2:edid/edid.bin" ];
hardware.firmware = [

View File

@@ -1,94 +1,74 @@
{ config, lib, pkgs, ... }:
{
############################
## Display + Mesa Settings
############################
# Enable OpenGL
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
vaapiIntel
intel-media-driver
nvidia-vaapi-driver
vpl-gpu-rt # for newer intel GPUs on NixOS >24.05 or unstable
];
};
# hardware.enableRedistributableFirmware = true;
# Load nvidia driver for Xorg and Wayland
# boot.extraModulePackages = [ config.boot.kernelPackages.nvidia_x11 ];
boot.extraModulePackages = [ config.boot.kernelPackages.nvidia_x11_beta ];
# boot.extraModulePackages = [ config.boot.kernelPackages.nvidia_x11 ];
hardware.firmware = [
pkgs.linux-firmware
pkgs.firmwareLinuxNonfree
# pkgs.firmwareLinuxStrict
# pkgs.firmwareLinuxLatest
];
boot.loader.systemd-boot.consoleMode = "max";
# boot.kernelPackages = pkgs.linuxPackages_latest;
boot.kernelParams = [
# "amdgpu.modeset=0"
"nvidia-drm.fbdev=1"
"console=tty0"
"efifb=off"
"xe.force_probe=*"
"nvidia-drm.modeset=1"
"nvidia.NVreg_PreserveVideoMemoryAllocations=1"
"i915.force_probe=e2ff"
# "amd_iommu=on"
# "vfio-pci.ids=\"10de:2489,10de:228b\""
# "nomodeset"
# "nvidia_drm.modeset=1"
];
boot.blacklistedKernelModules = [
# "i915"
"nouveau"
"amdgpu"
];
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver # Intel VAAPI
vpl-gpu-rt # oneVPL runtime
vaapiIntel # fallback
];
};
# Ensure Arc driver is available (usually auto-loaded)
boot.kernelModules = [ "xe" ];
boot.blacklistedKernelModules = [ "nouveau" ];
############################
## X / Wayland GPU Drivers
############################
# Only specify NVIDIA. Intel Arc uses the modesetting driver automatically.
services.xserver.videoDrivers = [ "nvidia" ];
boot.initrd.kernelModules = [
"nvidia"
"nvidia_drm"
];
############################
## NVIDIA Configuration
############################
hardware.nvidia = {
modesetting.enable = true;
modesetting.enable = true; # REQUIRED if any displays are on NVIDIA
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
# Enable this if you have graphical corruption issues or application crashes after waking
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
# of just the bare essentials.
powerManagement.enable = false;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = false;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
# Currently alpha-quality/buggy, so false is currently the recommended setting.
open = false;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
open = false; # GTX 1070 → must be the proprietary driver
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.beta;
# package = config.boot.kernelPackages.nvidiaPackages.none;
# package = config.boot.kernelPackages.nvidiaPackages.production;
forceFullCompositionPipeline = true;
powerManagement.enable = false;
powerManagement.finegrained = false;
prime = {
offload = {
enable = true;
enableOffloadCmd = true;
};
reverseSync.enable = false;
# Make sure to use the correct Bus ID values for your system!
intelBusId = "PCI:01:0:0";
nvidiaBusId = "PCI:05:0:0";
# amdgpuBusId = "PCI:50:0:0"; #For AMD GPU
offload.enable = false; # not a laptop, must be disabled
sync.enable = false;
};
# Correct way to pick the driver
package = config.boot.kernelPackages.nvidiaPackages.production;
};
users.users.andreas = {
extraGroups = [ "video" "render" ];
};
# Remove → hardware.nvidia handles module packages
# boot.extraModulePackages = [ config.boot.kernelPackages.nvidia_x11 ];
############################
## User Access
############################
users.users.andreas.extraGroups = [ "video" "render" ];
}

View File

@@ -4,7 +4,7 @@ let
in
{
my-namespace.hardware = {
graphics-nvidia-specializations = enabled;
# graphics-nvidia-specializations.enabled = false;
# graphics-nvidia-prime-amd = enabled;
# graphics-nvidia-prime-amd-testing = enabled;
# graphics-amd-igpu-only = enabled;

View File

@@ -16,11 +16,11 @@
boot.loader.systemd-boot.consoleMode = "max";
boot.kernelParams = [
"amdgpu.modeset=1"
# "amdgpu.modeset=0"
"nvidia-drm.fbdev=1"
"nvidia-drm.modeset=0"
# "nvidia.NVreg_PreserveVideoMemoryAllocations=0"
"amd_iommu=on"
"nvidia-drm.modeset=1"
"nvidia.NVreg_PreserveVideoMemoryAllocations=1"
# "amd_iommu=on"
# "vfio-pci.ids=\"10de:2489,10de:228b\""
# "nomodeset"
# "nvidia_drm.modeset=1"
@@ -28,60 +28,22 @@
boot.blacklistedKernelModules = [
"i915"
"nouveau"
# "nvidia"
# "nvidia-drm"
# "nvidia-uvm"
# "nvidiafb"
# "nvidia_drm"
# "nvidia_modeset"
];
# boot.extraModprobeConfig = ''
# blacklist nvidia
# blacklist nvidia-drm
# blacklist nvidia_drm
# blacklist nvidia-uvm
# blacklist nvidia_uvm
# blacklist nvidia_modeset
# blacklist nvidiafb
# blacklist nouveau
# options nouveau modeset=0
# '';
boot.extraModprobeConfig = ''
blacklist nouveau
options nouveau modeset=0
'';
# services.xserver.videoDrivers = [ "nvidia" ];
services.xserver.videoDrivers = [ "amdgpu" "nvidia" ];
# services.udev.extraRules = ''
# # Remove NVIDIA USB xHCI Host Controller devices, if present
# ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{power/control}="auto", ATTR{remove}="1"
# # Remove NVIDIA USB Type-C UCSI devices, if present
# ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c8000", ATTR{power/control}="auto", ATTR{remove}="1"
# # Remove NVIDIA Audio devices, if present
# ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{power/control}="auto", ATTR{remove}="1"
# # Remove NVIDIA VGA/3D controller devices
# ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x03[0-9]*", ATTR{power/control}="auto", ATTR{remove}="1"
# '';
boot.initrd.kernelModules = [
"amdgpu"
];
services.xserver.videoDrivers = [ "nvidia" ];
boot.initrd.kernelModules = [
"nvidia"
# "nvidia-drm"
"nvidiafb"
# "nvidia-uvm"
# "nvidia-modeset"
# "i2c-nvidia_gpu"
"nvidia_drm"
];
hardware.nvidia = {
# Modesetting is required.
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
# Enable this if you have graphical corruption issues or application crashes after waking
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
# of just the bare essentials.
powerManagement.enable = true;
powerManagement.enable = false;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
@@ -105,19 +67,19 @@
# package = config.boot.kernelPackages.nvidiaPackages.none;
# package = config.boot.kernelPackages.nvidiaPackages.production;
forceFullCompositionPipeline = false;
forceFullCompositionPipeline = true;
prime = {
offload = {
enable = true;
enableOffloadCmd = true;
};
reverseSync.enable = false;
# Make sure to use the correct Bus ID values for your system!
# intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:01:0:0";
amdgpuBusId = "PCI:50:0:0"; #For AMD GPU
};
# prime = {
# offload = {
# enable = true;
# enableOffloadCmd = true;
# };
# reverseSync.enable = false;
# # Make sure to use the correct Bus ID values for your system!
# # intelBusId = "PCI:0:2:0";
# nvidiaBusId = "PCI:01:0:0";
# amdgpuBusId = "PCI:50:0:0"; #For AMD GPU
# };
};
users.users.andreas = {

View File

@@ -7,18 +7,19 @@
imports =
[
(modulesPath + "/installer/scan/not-detected.nix")
./graphics/nvidia-stable.nix
./graphics/intel_nvidia.nix
# ./graphics/nvidia.nix
./acer-monitor-edid.nix
];
#boot.kernelPackages = pkgs.linuxPackages_latest;
boot.kernelPackages = pkgs.linuxPackages_latest;
hardware.enableRedistributableFirmware = true;
# boot.kernelPackages = pkgs.linuxKernel.packages.linux_xanmod_latest;
boot.kernelPackages = pkgs.linuxPackages;
# boot.kernelPackages = pkgs.linuxPackages;
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
boot.kernelModules = [ "kvm-amd" "4vl2loopback" ];
boot.extraModulePackages = [ pkgs.linuxPackages.v4l2loopback ];
boot.extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ];
boot.supportedFilesystems = [ "ntfs" ];
boot.blacklistedKernelModules = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/563805a1-5277-4488-bbdd-c1a7ed37be76";

View File

@@ -5,7 +5,7 @@
];
boot.extraModulePackages = [
pkgs.linuxPackages.v4l2loopback # Webcam loopback
config.boot.kernelPackages.v4l2loopback # Webcam loopback
];
boot.extraModprobeConfig = ''