From 231274268ff2250d4730e274b808f66ef91b6381 Mon Sep 17 00:00:00 2001 From: Lyndon Sanche Date: Wed, 26 Jun 2024 16:51:35 -0600 Subject: [PATCH] gpu/amd: Remove `loadInInitrd` option Option is now in nixpkgs under `hardware.amdgpu.initrd.enable` as of NixOS/nixpkgs@6a0b6a6b74a71be7c37b9d8bc4472cf087aff709 --- asus/zephyrus/ga402x/nvidia/default.nix | 2 +- common/gpu/amd/default.nix | 29 ++++++++---------------- lenovo/legion/15ach6h/hybrid/default.nix | 2 +- lenovo/legion/16ach6h/hybrid/default.nix | 2 +- lenovo/yoga/7/14ARH7/nvidia/default.nix | 2 +- 5 files changed, 14 insertions(+), 23 deletions(-) diff --git a/asus/zephyrus/ga402x/nvidia/default.nix b/asus/zephyrus/ga402x/nvidia/default.nix index 99dfa9b..6f759fd 100644 --- a/asus/zephyrus/ga402x/nvidia/default.nix +++ b/asus/zephyrus/ga402x/nvidia/default.nix @@ -26,7 +26,7 @@ in { hardware = { ## Enable the Nvidia card, as well as Prime and Offload: - amdgpu.loadInInitrd = true; + amdgpu.initrd.enable = lib.mkDefault true; nvidia = { modesetting.enable = true; diff --git a/common/gpu/amd/default.nix b/common/gpu/amd/default.nix index ca103fc..5373004 100644 --- a/common/gpu/amd/default.nix +++ b/common/gpu/amd/default.nix @@ -1,24 +1,15 @@ -{ config, lib, ... }: +{ lib, ... }: { - options.hardware.amdgpu.loadInInitrd = lib.mkEnableOption (lib.mdDoc - "loading `amdgpu` kernelModule at stage 1. (Add `amdgpu` to `boot.initrd.kernelModules`)" - ) // { - default = true; - }; - imports = [ ../24.05-compat.nix ]; - config = lib.mkMerge [ - { - services.xserver.videoDrivers = lib.mkDefault [ "modesetting" ]; + config = { + services.xserver.videoDrivers = lib.mkDefault [ "modesetting" ]; - hardware.graphics = { - enable = lib.mkDefault true; - enable32Bit = lib.mkDefault true; - }; - } - (lib.mkIf config.hardware.amdgpu.loadInInitrd { - boot.initrd.kernelModules = [ "amdgpu" ]; - }) - ]; + hardware.graphics = { + enable = lib.mkDefault true; + enable32Bit = lib.mkDefault true; + }; + + hardware.amdgpu.initrd.enable = lib.mkDefault true; + }; } diff --git a/lenovo/legion/15ach6h/hybrid/default.nix b/lenovo/legion/15ach6h/hybrid/default.nix index b9070fb..2f12f7e 100644 --- a/lenovo/legion/15ach6h/hybrid/default.nix +++ b/lenovo/legion/15ach6h/hybrid/default.nix @@ -20,7 +20,7 @@ services.xserver.videoDrivers = [ "nvidia" ]; hardware = { - amdgpu.loadInInitrd = lib.mkDefault false; + amdgpu.initrd.enable = false; nvidia = { modesetting.enable = lib.mkDefault true; diff --git a/lenovo/legion/16ach6h/hybrid/default.nix b/lenovo/legion/16ach6h/hybrid/default.nix index a33a02a..f07b837 100644 --- a/lenovo/legion/16ach6h/hybrid/default.nix +++ b/lenovo/legion/16ach6h/hybrid/default.nix @@ -22,7 +22,7 @@ services.xserver.videoDrivers = [ "nvidia" ]; hardware = { - amdgpu.loadInInitrd = lib.mkDefault false; + amdgpu.initrd.enable = false; nvidia = { modesetting.enable = lib.mkDefault true; diff --git a/lenovo/yoga/7/14ARH7/nvidia/default.nix b/lenovo/yoga/7/14ARH7/nvidia/default.nix index 9707745..0ca5afd 100644 --- a/lenovo/yoga/7/14ARH7/nvidia/default.nix +++ b/lenovo/yoga/7/14ARH7/nvidia/default.nix @@ -18,7 +18,7 @@ in { hardware = { ## Enable the Nvidia card, as well as Prime and Offload: - amdgpu.loadInInitrd = true; + amdgpu.initrd.enable = true; nvidia = { modesetting.enable = true;