From 963e12e041403f35679a9703452daa2f271c1de0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Zavala=20Villag=C3=B3mez?= Date: Thu, 26 Dec 2024 00:16:42 -0500 Subject: [PATCH] lenovo/yoga/7/14IAH7: add profile for 14IAH7 (Lenovo Yoga Slim 7i Pro X) There is already a profile for the AMD version of this device, being the Lenovo `14ARH7` (Lenovo Yoga Slim 7 Pro X) under `lenovo/yoga/7/14IAH7`. I opted to make an entirely separate profile, rather than sharing with it, since I don't have that device to confirm that unintended changes aren't introduced. - Add profile for `14IAH7` - Update `README.md` - Update `flake.nix` --- README.md | 2 ++ flake.nix | 2 ++ lenovo/yoga/7/14IAH7/hybrid/default.nix | 39 +++++++++++++++++++++ lenovo/yoga/7/14IAH7/integrated/default.nix | 28 +++++++++++++++ lenovo/yoga/7/14IAH7/shared.nix | 23 ++++++++++++ 5 files changed, 94 insertions(+) create mode 100644 lenovo/yoga/7/14IAH7/hybrid/default.nix create mode 100644 lenovo/yoga/7/14IAH7/integrated/default.nix create mode 100644 lenovo/yoga/7/14IAH7/shared.nix diff --git a/README.md b/README.md index a0b046553..6a5cf0d69 100644 --- a/README.md +++ b/README.md @@ -292,6 +292,8 @@ See code for all available configurations. | [LENOVO Yoga 6 13ALC6 82ND](lenovo/yoga/6/13ALC6) | `` | | [LENOVO Yoga Slim 7 Pro-X 14ARH7 82ND](lenovo/yoga/7/14ARH7/amdgpu) | `` | | [LENOVO Yoga Slim 7 Pro-X 14ARH7 82ND](lenovo/yoga/7/14ARH7/nvidia) | `` | +| [Lenovo Yoga Slim 7i Pro X 14IAH7 (Integrated)](lenovo/yoga/7/14IAH7/integrated) |`` | +| [Lenovo Yoga Slim 7i Pro X 14IAH7 (Hybrid)](lenovo/yoga/7/14IAH7/hybrid) |`` | | [LENOVO Yoga 7 Slim Gen8](lenovo/yoga/7/slim/gen8) | `` | | [MSI B550-A PRO](msi/b550-a-pro) | `` | | [MSI B350 TOMAHAWK](msi/b350-tomahawk) | `` | diff --git a/flake.nix b/flake.nix index 44bedb0a0..2b0449ac7 100644 --- a/flake.nix +++ b/flake.nix @@ -238,6 +238,8 @@ lenovo-yoga-7-14ARH7 = import ./lenovo/yoga/7/14ARH7; lenovo-yoga-7-14ARH7-amdgpu = import ./lenovo/yoga/7/14ARH7/amdgpu; lenovo-yoga-7-14ARH7-nvidia = import ./lenovo/yoga/7/14ARH7/nvidia; + lenovo-yoga-7-14IAH7-integrated = import ./lenovo/yoga/7/14IAH7/integrated; + lenovo-yoga-7-14IAH7-hybrid = import ./lenovo/yoga/7/14IAH7/hybrid; lenovo-yoga-7-slim-gen8 = import ./lenovo/yoga/7/slim/gen8; letsnote-cf-lx4 = import ./panasonic/letsnote/cf-lx4; malibal-aon-s1-intel = import ./malibal/aon/s1; diff --git a/lenovo/yoga/7/14IAH7/hybrid/default.nix b/lenovo/yoga/7/14IAH7/hybrid/default.nix new file mode 100644 index 000000000..d202352c9 --- /dev/null +++ b/lenovo/yoga/7/14IAH7/hybrid/default.nix @@ -0,0 +1,39 @@ +/* + * `lenovo-yoga-7-14IAH7-hybrid`: + * + * This is a hybrid profile that enables the NVIDIA + * driver and PRIME offload mode for making use of both + * integrated and dedicated graphics. Use this profile if + * you want to use the NVIDIA GeForce RTX 3050 Mobile. + * Read about PRIME offload mode here: + * + * + * The `lenovo-yoga-7-14IAH7-integrated` profile only + * has the integrated Intel GPU enabled. The dedicated + * NVIDIA GPU is disabled entirely. Use that profile + * instead if you want to only use integrated graphics. + * + * `nouveau` wasn't added to any profiles since it + * is known to cause freezes for this device. + * `nouveau` is blacklisted by default when enabling this: + * + */ +{ lib, ... }: +{ + imports = [ + ../shared.nix + ../../../../../common/gpu/nvidia/ampere + ../../../../../common/gpu/nvidia/prime.nix + ]; + + hardware.nvidia = { + # Info: + prime = { + intelBusId = "PCI:0:2:0"; + nvidiaBusId = "PCI:1:0:0"; + }; + + # Info: + powerManagement.enable = lib.mkDefault true; + }; +} diff --git a/lenovo/yoga/7/14IAH7/integrated/default.nix b/lenovo/yoga/7/14IAH7/integrated/default.nix new file mode 100644 index 000000000..6ba257b0d --- /dev/null +++ b/lenovo/yoga/7/14IAH7/integrated/default.nix @@ -0,0 +1,28 @@ +/* + * `lenovo-yoga-7-14IAH7-integrated`: + * + * This profile only has the integrated Intel GPU + * enabled. The dedicated NVIDIA GPU is disabled + * entirely. Use this profile if you want to only + * use the integrated GPU. + * + * It is recommended to use this profile to disable + * dedicated graphics, rather than doing it through + * the BIOS, since that method causes issues with + * the integrated graphics drivers. Doing it + * through blacklisting achieves the same result + * with no side-effects. + * + * The `lenovo-yoga-7-14IAH7-hybrid` hybrid profile + * enables the NVIDIA driver and PRIME offload mode + * for making use of both GPUs. Use that profile + * instead if you want to use the NVIDIA GPU. + * Read about PRIME offload mode here: + * + */ +{ + imports = [ + ../shared.nix + ../../../../../common/gpu/nvidia/disable.nix + ]; +} diff --git a/lenovo/yoga/7/14IAH7/shared.nix b/lenovo/yoga/7/14IAH7/shared.nix new file mode 100644 index 000000000..bbce735be --- /dev/null +++ b/lenovo/yoga/7/14IAH7/shared.nix @@ -0,0 +1,23 @@ +/* + * Here are configurations for the + * Intel Core i7-12700H CPU, along + * with a few others. + */ +{ + imports = [ + ../../../../common/cpu/intel/alder-lake + ../../../../common/gpu/intel/alder-lake + ../../../../common/pc/laptop + ../../../../common/pc/ssd + ]; + + boot = { + kernelModules = [ "kvm-intel" ]; + kernelParams = [ + # Info: + "acpi.prefer_microsoft_dsm_guid=1" + # Info: + "pcie_aspm.policy=powersupersave" + ]; + }; +}