nvidia fixes

This commit is contained in:
Remy Moll 2025-01-13 13:51:22 +01:00
parent b2a1f39893
commit d58bd057ac
2 changed files with 40 additions and 1 deletions

View File

@ -0,0 +1,17 @@
{pkgs, ...}:
{
# Add a udev rule that launches a backup using restic when a specific USB device (the backup drive) is plugged in
environment.systemPackages = with pkgs; [
restic
];
services.udev.packages = [
(pkgs.writeTextFile {
name = "bakc";
text = ''
SUBSYSTEMS=="usb", ATTRS{idVendor}=="3297", ATTRS{idProduct}=="1969", MODE="0666", TAG+="uaccess", SYMLINK+="stm32_dfu", GROUP="plugdev"
'';
destination = "/etc/udev/rules.d/50-zsa.rules";
})
];
}

View File

@ -65,8 +65,30 @@
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}=="0x030000", ATTR{power/control}="auto", ATTR{remove}="1"
# Remove the whole bridge responsible for the VGA/3D controller
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{class}=="0x060400", ATTR{power/control}="auto", ATTR{remove}="1"
'';
boot.blacklistedKernelModules = lib.mkDefault [ "nouveau" "nvidia" "nvidia_drm" "nvidia_modeset" ];
# # somehow the udev rules are not enough to prevent the nouveau driver from loading
# # Also unload remove the bus by id manually
# # unload 0000:01:00.1 and 0000:01:00.0
# # at boot echo 1 > /sys/bus/pci/devices/0000:01:00.1/remove
# # at boot echo 1 > /sys/bus/pci/devices/0000:01:00.0/remove
# systemd.services.remove-nouveau = {
# description = "Remove Nouveau PCI devices";
# wantedBy = [ "multi-user.target" ];
# after = [ "sysinit.target" ];
# serviceConfig = {
# Type = "oneshot";
# ExecStart = "${pkgs.coreutils}/bin/echo 1 > /sys/bus/pci/devices/0000:01:00.1/remove";
# ExecStart = "${pkgs.coreutils}/bin/echo auto > /sys/bus/pci/devices/0000:00:01.0/power/control";
# ExecStart = "${pkgs.coreutils}/bin/echo 1 > /sys/bus/pci/devices/0000:01:00.0/remove";
# ExecStart = "${pkgs.coreutils}/bin/echo auto > /sys/bus/pci/devices/0000:00:01.0/power/control";
# };
# };
boot.blacklistedKernelModules = lib.mkDefault [ "nouveau" "nvidia" "nvidia_drm" "nvidia_modeset" ];
}