Graphics fixes :|

This commit is contained in:
Emmet 2025-10-25 21:54:55 -05:00
parent 68e2da66c8
commit 98b74c560c
8 changed files with 41 additions and 61 deletions

View file

@ -9,6 +9,7 @@
# hardware
cachy.enable = true;
cachy.variant = "lts";
bluetooth.enable = true;
powerprofiles.enable = true;
tlp.enable = false;
@ -66,5 +67,5 @@
services.displayManager.defaultSession = "hyprland";
};
}

View file

@ -1,7 +1,7 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, inputs, ... }:
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
@ -22,33 +22,9 @@
# https://wiki.nixos.org/wiki/Mesa
hardware = {
graphics =
let
fn = oa: {
nativeBuildInputs = oa.nativeBuildInputs ++ [ pkgs.glslang ];
mesonFlags = oa.mesonFlags ++ [ "-Dvulkan-layers=device-select,overlay" ];
# patches = oa.patches ++ [ ./mesa-vulkan-layer-nvidia.patch ]; See below
postInstall = oa.postInstall + ''
mv $out/lib/libVkLayer* $drivers/lib
#Device Select layer
layer=VkLayer_MESA_device_select
substituteInPlace $drivers/share/vulkan/implicit_layer.d/''${layer}.json \
--replace "lib''${layer}" "$drivers/lib/lib''${layer}"
#Overlay layer
layer=VkLayer_MESA_overlay
substituteInPlace $drivers/share/vulkan/explicit_layer.d/''${layer}.json \
--replace "lib''${layer}" "$drivers/lib/lib''${layer}"
'';
};
in
with pkgs; {
enable = true;
enable32Bit = true;
package = (mesa.overrideAttrs fn).drivers;
package32 = (pkgsi686Linux.mesa.overrideAttrs fn).drivers;
#extraPackages = with pkgs; [ amdvlk ];
#extraPackages32 = with pkgs; [ driversi686Linux.amdvlk ];
};
};
hardware.opengl.extraPackages = [ pkgs.rocmPackages.clr.icd ];
@ -61,10 +37,9 @@
hardware.amdgpu.initrd.enable = true;
hardware.amdgpu.opencl.enable = true;
#hardware.amdgpu.amdvlk.enable = true;
#hardware.amdgpu.overdrive.enable = true;
environment.sessionVariables = {
VK_ICD_FILENAMES = "/run/opengl-driver/share/vulkan/icd.d/radeon_icd.x86_64.json"; # fix for godot
#VK_ICD_FILENAMES = "/run/opengl-driver/share/vulkan/icd.d/radeon_icd.x86_64.json"; # fix for godot
};
# makes disk io not freeze the computer
@ -72,7 +47,7 @@
ACTION=="add|change", SUBSYSTEM=="block", ENV{ID_SERIAL_SHORT}=="BTKA121225GP512A", ATTR{queue/scheduler}="bfq"
'';
#systemd.tmpfiles.rules =
#systemd.tmpfiles.rules =
# let
# rocmEnv = pkgs.symlinkJoin {
# name = "rocm-combined";
@ -86,7 +61,7 @@
# "L+ /opt/rocm - - - - ${rocmEnv}"
# ];
# my stupid usb hub crashes systemct suspend half of the time now
# my stupid usb hub crashes systemctl suspend half of the time now
# https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Sleep_hooks
systemd.services.root-suspend = {
enable = true;
@ -134,7 +109,7 @@
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking