From cedb27beb1840e2856b0769025392ba82925bb5c Mon Sep 17 00:00:00 2001 From: Mic92 <96200+Mic92@users.noreply.github.com> Date: Sun, 26 May 2024 08:04:14 +0000 Subject: [PATCH 01/88] Added config for Huawei Matebook X Pro (2020) (#957) Created a config file for Huawei Matebook X Pro (2020). This file should work on all versions other than MACHC-WAH9L as that one does not include the Nvidia MX250 dGPU. --- README.md | 1 + flake.nix | 1 + huawei/machc-wa/README.md | 3 +++ huawei/machc-wa/default.nix | 28 ++++++++++++++++++++++++++++ 4 files changed, 33 insertions(+) create mode 100644 huawei/machc-wa/README.md create mode 100644 huawei/machc-wa/default.nix diff --git a/README.md b/README.md index 03d35a0..d3ca5c8 100644 --- a/README.md +++ b/README.md @@ -164,6 +164,7 @@ See code for all available configurations. | [HP Elitebook 845g8](hp/elitebook/845/g8) | `` | | [HP Elitebook 845g9](hp/elitebook/845/g9) | `` | | [HP Notebook 14-df0023](hp/notebook/14-df0023) | `` | +| [Huawei Matebook X Pro (2020)](huawei/machc-wa) | `` | | [i.MX8QuadMax Multisensory Enablement Kit](nxp/imx8qm-mek/) | `` | | [Intel NUC 8i7BEH](intel/nuc/8i7beh/) | `` | | [Lenovo IdeaPad Gaming 3 15arh05](lenovo/ideapad/15arh05) | `` | diff --git a/flake.nix b/flake.nix index b4d6343..58621d7 100644 --- a/flake.nix +++ b/flake.nix @@ -96,6 +96,7 @@ hp-elitebook-845g7 = import ./hp/elitebook/845/g7; hp-elitebook-845g8 = import ./hp/elitebook/845/g8; hp-elitebook-845g9 = import ./hp/elitebook/845/g9; + huawei-machc-wa = import ./huawei/machc-wa; hp-notebook-14-df0023 = import ./hp/notebook/14-df0023; intel-nuc-8i7beh = import ./intel/nuc/8i7beh; lenovo-ideapad-15arh05 = import ./lenovo/ideapad/15arh05; diff --git a/huawei/machc-wa/README.md b/huawei/machc-wa/README.md new file mode 100644 index 0000000..27a1ccf --- /dev/null +++ b/huawei/machc-wa/README.md @@ -0,0 +1,3 @@ +# Huawei Matebook X Pro (2020) + +This is a very standard device that needs little configuration. The module mainly imports the common modules for its CPU, GPU, SSD etc. and enables ppd for power management. Nvidia prime offload is also enabled. This configuration should work with all Matebook X Pro models from 2020 (MACHC-WA*) other than MACHC-WAH9L as it does not contain the Nvidia GPU. \ No newline at end of file diff --git a/huawei/machc-wa/default.nix b/huawei/machc-wa/default.nix new file mode 100644 index 0000000..e2bc0a8 --- /dev/null +++ b/huawei/machc-wa/default.nix @@ -0,0 +1,28 @@ +{ + lib, + pkgs, + config, + ... +}: { + imports = [ + ../../common/cpu/intel + ../../common/cpu/intel/comet-lake + ../../common/gpu/nvidia + ../../common/gpu/nvidia/prime.nix + ../../common/hidpi.nix + ../../common/pc/laptop + ../../common/pc/ssd + ]; + + hardware.nvidia = { + modesetting.enable = lib.mkDefault true; + open = lib.mkDefault false; + nvidiaSettings = lib.mkDefault true; + prime = { + intelBusId = "PCI:0:2:0"; + nvidiaBusId = "PCI:1:0:0"; + }; + }; + + services.power-profiles-daemon.enable = lib.mkDefault true; +} From 33026a05f412560c0979f14b20fa397d6e08ea31 Mon Sep 17 00:00:00 2001 From: "Bradon Kanyid (rattboi)" Date: Fri, 24 May 2024 04:54:53 +0000 Subject: [PATCH 02/88] framework: Add framework-laptop-kmod for 16" model as well in https://github.com/NixOS/nixos-hardware/pull/903 , the framework-laptop-kmod was added, and automatically setup for 13" models. The 16" model will also be able to take advantage of the kmod, once the 6.10 kernel patches are in place. Kernel Patchset: https://lore.kernel.org/chrome-platform/20231005160701.19987-1-dustin@howett.net/ --- framework/16-inch/common/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/framework/16-inch/common/default.nix b/framework/16-inch/common/default.nix index 9dc402c..547f98f 100644 --- a/framework/16-inch/common/default.nix +++ b/framework/16-inch/common/default.nix @@ -2,6 +2,7 @@ imports = [ ../../../common/pc/laptop ../../../common/pc/laptop/ssd + ../../kmod.nix ../../framework-tool.nix ]; From 816528f00e287f7eadc57a0be382442516b89070 Mon Sep 17 00:00:00 2001 From: Andre Date: Thu, 23 May 2024 20:40:09 -0400 Subject: [PATCH 03/88] Add kernel version check for Lenovo 16ARHA7 speaker fix --- lenovo/legion/16arha7/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lenovo/legion/16arha7/default.nix b/lenovo/legion/16arha7/default.nix index da8174b..36b10ee 100644 --- a/lenovo/legion/16arha7/default.nix +++ b/lenovo/legion/16arha7/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, pkgs, lib, ... }: let lenovo-speaker-fix = pkgs.callPackage ./audio/lenovo-16ARHA7_speaker-fix.nix { @@ -14,7 +14,8 @@ in ../../../common/pc/laptop/ssd ]; - boot.extraModulePackages = [ lenovo-speaker-fix ]; + # Kernel 6.9 includes the speaker fix, so only install this on systems with older kernels. + boot.extraModulePackages = lib.mkIf (!(lib.versionOlder config.boot.kernelPackages.kernel.version "6.9")) [ lenovo-speaker-fix ]; # √(2560² + 1600²) px / 16 in ≃ 189 dpi services.xserver.dpi = 189; From 888d915fe8aae23214a38833ccafb04a87d9177d Mon Sep 17 00:00:00 2001 From: Andre Date: Thu, 23 May 2024 23:46:30 -0400 Subject: [PATCH 04/88] Update readme for 16arha7 --- lenovo/legion/16arha7/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lenovo/legion/16arha7/README.md b/lenovo/legion/16arha7/README.md index 9c8193a..7e80688 100644 --- a/lenovo/legion/16arha7/README.md +++ b/lenovo/legion/16arha7/README.md @@ -1,6 +1,6 @@ ## Introduction -This configuration includes a fix to get audio playing over the speakers, however, the volume is low. If you know of a workaround or fix, please contribute it to the repo!! +This configuration includes a fix to get the speakers working on kernels earlier than 6.9.0. Kernels after 6.9.0 already have this patch built-in. ## Setup at the time of testing ``` From d946893c3b99dab02f97dbde49d3c62223d4ef68 Mon Sep 17 00:00:00 2001 From: Andy3153 Date: Mon, 20 May 2024 00:55:37 +0300 Subject: [PATCH 05/88] add config for ASUS TUF FX506HM --- README.md | 1 + asus/fx506hm/README.md | 28 ++++++++++++++++++++++++++++ asus/fx506hm/default.nix | 24 ++++++++++++++++++++++++ flake.nix | 1 + 4 files changed, 54 insertions(+) create mode 100644 asus/fx506hm/README.md create mode 100644 asus/fx506hm/default.nix diff --git a/README.md b/README.md index d3ca5c8..23ebd3b 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,7 @@ See code for all available configurations. | [Asus ROG Zephyrus G15 GA503](asus/zephyrus/ga503) | `` | | [Asus ROG Zephyrus M16 GU603H](asus/zephyrus/gu603h) | `` | | [Asus TUF FX504GD](asus/fx504gd) | `` | +| [Asus TUF FX506HM](asus/fx506hm) | `` | | [Asus TUF FA507RM](asus/fa507rm) | `` | | [Asus TUF FA507NV](asus/fa507nv) | `` | | [BeagleBoard PocketBeagle](beagleboard/pocketbeagle) | `` | diff --git a/asus/fx506hm/README.md b/asus/fx506hm/README.md new file mode 100644 index 0000000..d20ee88 --- /dev/null +++ b/asus/fx506hm/README.md @@ -0,0 +1,28 @@ + +# [ASUS TUF Gaming F15 FX506HM (2021)](https://www.asus.com/laptops/for-gaming/tuf-gaming/2021-asus-tuf-gaming-f15/) + +This imports common modules for the Intel CPU and iGPU, Nvidia and PRIME render offloading, basic laptop configs, basic SSD configs and configs for ASUS batteries. + +On top of that, it sets the right PCI bus IDs for the iGPU and dGPU to make PRIME work well and enables modesetting. + +## Useful other things to consider in your configuration +### Battery charging limit +Due to the common module for ASUS batteries, you can make your battery only charge up to a certain percentage to improve its life. You can place something similar to the following in your configuration to enable it: + +```nix +hardware.asus.battery = +{ + chargeUpto = 85; # Maximum level of charge for your battery, as a percentage. + enableChargeUptoScript = true; # Whether to add charge-upto to environment.systemPackages. `charge-upto 85` temporarily sets the charge limit to 85%. +}; +``` + +### OpenRGB +You can use OpenRGB to control the RGB keyboard on this laptop. There's also plugins for it to get some extra RGB lighting modes if you wish. You can place the following in your configuration to enable it: + +```nix +boot.kernelModules = [ "i2c-dev" ]; +hardware.i2c.enable = true; +services.udev.packages = [ pkgs.openrgb ]; +services.hardware.openrgb.enable = true; +``` diff --git a/asus/fx506hm/default.nix b/asus/fx506hm/default.nix new file mode 100644 index 0000000..90b32cf --- /dev/null +++ b/asus/fx506hm/default.nix @@ -0,0 +1,24 @@ +{ lib, ... }: + +{ + imports = + [ + ../../common/cpu/intel + ../../common/gpu/nvidia + ../../common/gpu/nvidia/prime.nix + ../../common/pc/laptop + ../../common/pc/ssd + ../battery.nix + ] + + hardware.nvidia = + { + modesetting.enable = lib.mkDefault true; + + prime = + { + intelBusId = "PCI:0:2:0"; + nvidiaBusId = "PCI:1:0:0"; + }; + }; +} diff --git a/flake.nix b/flake.nix index 58621d7..243485b 100644 --- a/flake.nix +++ b/flake.nix @@ -18,6 +18,7 @@ asus-battery = import ./asus/battery.nix; asus-ally-rc71l = import ./asus/ally/rc71l; asus-fx504gd = import ./asus/fx504gd; + asus-fx506hm = import ./asus/fx506hm; asus-fa507nv = import ./asus/fa507nv; asus-fa507rm = import ./asus/fa507rm; asus-pro-ws-x570-ace = import ./asus/pro-ws-x570-ace; From 449b3abafabff9057de95d2f92fd2eaac4da024d Mon Sep 17 00:00:00 2001 From: Andy3153 Date: Mon, 20 May 2024 13:15:58 +0300 Subject: [PATCH 06/88] fix error --- asus/fx506hm/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asus/fx506hm/default.nix b/asus/fx506hm/default.nix index 90b32cf..115882b 100644 --- a/asus/fx506hm/default.nix +++ b/asus/fx506hm/default.nix @@ -9,7 +9,7 @@ ../../common/pc/laptop ../../common/pc/ssd ../battery.nix - ] + ]; hardware.nvidia = { From 7caa5b2a35c4ae70328f853b3fe24870cb35a8a6 Mon Sep 17 00:00:00 2001 From: Andre Date: Sun, 12 May 2024 11:47:49 -0400 Subject: [PATCH 07/88] Add Surface Pro 9 with Intel PSR disabled --- flake.nix | 1 + microsoft/surface-pro/9/default.nix | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 microsoft/surface-pro/9/default.nix diff --git a/flake.nix b/flake.nix index 243485b..8ea11c7 100644 --- a/flake.nix +++ b/flake.nix @@ -203,6 +203,7 @@ microsoft-surface-laptop-amd = import ./microsoft/surface/surface-laptop-amd; microsoft-surface-common = import ./microsoft/surface/common; microsoft-surface-pro-3 = import ./microsoft/surface-pro/3; + microsoft-surface-pro-9 = import ./microsoft/surface-pro/9; milkv-pioneer = import ./milkv/pioneer; morefine-m600 = import ./morefine/m600; msi-b350-tomahawk = import ./msi/b350-tomahawk; diff --git a/microsoft/surface-pro/9/default.nix b/microsoft/surface-pro/9/default.nix new file mode 100644 index 0000000..60b82ad --- /dev/null +++ b/microsoft/surface-pro/9/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ ../../surface/surface-pro-intel ]; + + boot.kernelParams = [ "i915.enable_psr=0" ]; # Disable Intel Panel Self Refresh +} \ No newline at end of file From 1af5ef15469a55bef1a9136324437e4ddede2c5c Mon Sep 17 00:00:00 2001 From: Andre Date: Sun, 12 May 2024 12:00:44 -0400 Subject: [PATCH 08/88] Add Readme for Surface Pro 9 --- microsoft/surface-pro/9/README.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 microsoft/surface-pro/9/README.md diff --git a/microsoft/surface-pro/9/README.md b/microsoft/surface-pro/9/README.md new file mode 100644 index 0000000..5ec8e80 --- /dev/null +++ b/microsoft/surface-pro/9/README.md @@ -0,0 +1,7 @@ +# Microsoft Surface Pro 9 + +## Note on Intel Panel Self Refresh (PSR) + +Intel GPUs support a feature called [Panel Self Refresh (PSR)](https://www.intel.com/content/www/us/en/support/articles/000057194/graphics.html), where the display refreshes independently of the OS. Out of the box, this can cause lots of display lag, stuttering, and enormous refresh rate drops. + +This configuration disables PSR by adding `i915.enable_psr=0` to the kernel boot parameters, at the cost of some battery life. If you want to turn PSR back on, add `i915.enable_psr=1` to your `boot.kernelParams`. From d789d9a2de2cea67655d38b7a37a30bdb1838e8b Mon Sep 17 00:00:00 2001 From: Andre Date: Mon, 20 May 2024 10:10:00 -0400 Subject: [PATCH 09/88] Add Surface Pro 9 to Readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 23ebd3b..4b85142 100644 --- a/README.md +++ b/README.md @@ -269,6 +269,7 @@ See code for all available configurations. | [Microsoft Surface Laptop (AMD)](microsoft/surface/surface-laptop-amd) | `` | | [Microsoft Surface Range (Common Modules)](microsoft/surface/common) | `` | | [Microsoft Surface Pro 3](microsoft/surface-pro/3) | `` | +| [Microsoft Surface Pro 9](microsoft/surface-pro/9) | `` | | [Morefine M600](morefine/m600) | `` | | [NXP iMX8 MPlus Evaluation Kit](nxp/imx8mp-evk) | `` | | [NXP iMX8 MQuad Evaluation Kit](nxp/imx8mq-evk) | `` | From 2e7d6c568063c83355fe066b8a8917ee758de1b8 Mon Sep 17 00:00:00 2001 From: fidgetingbits Date: Mon, 20 May 2024 10:06:05 +0800 Subject: [PATCH 10/88] asus/zenbook/ux371: init --- README.md | 1 + asus/zenbook/ux371/README.md | 47 ++++++++++++++ asus/zenbook/ux371/default.nix | 24 +++++++ common/cpu/intel/cpu-only.nix | 4 +- common/cpu/intel/tiger-lake/default.nix | 12 ++++ common/gpu/intel/default.nix | 84 +++++++++++++++++-------- flake.nix | 1 + 7 files changed, 144 insertions(+), 29 deletions(-) create mode 100644 asus/zenbook/ux371/README.md create mode 100644 asus/zenbook/ux371/default.nix create mode 100644 common/cpu/intel/tiger-lake/default.nix diff --git a/README.md b/README.md index 4b85142..56fdd7a 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,7 @@ See code for all available configurations. | [Asus TUF FX506HM](asus/fx506hm) | `` | | [Asus TUF FA507RM](asus/fa507rm) | `` | | [Asus TUF FA507NV](asus/fa507nv) | `` | +| [Asus Zenbook Flip S13 UX371](asus/zenbook/ux371/) | `` | | [BeagleBoard PocketBeagle](beagleboard/pocketbeagle) | `` | | [Deciso DEC series](deciso/dec) | `` | | [Dell G3 3779](dell/g3/3779) | `` | diff --git a/asus/zenbook/ux371/README.md b/asus/zenbook/ux371/README.md new file mode 100644 index 0000000..6effc44 --- /dev/null +++ b/asus/zenbook/ux371/README.md @@ -0,0 +1,47 @@ +# Asus Zenbook Flip S13 + +This is tested on an [UX371](https://www.asus.com/laptops/for-home/zenbook/zenbook-flip-s-ux371-11th-gen-intel/). + +## Tested Hardware + +```bash +lspci -nn +0000:00:00.0 Host bridge [0600]: Intel Corporation 11th Gen Core Processor Host Bridge/DRAM Registers [8086:9a14] (rev 01) +0000:00:02.0 VGA compatible controller [0300]: Intel Corporation TigerLake-LP GT2 [Iris Xe Graphics] [8086:9a49] (rev 01) +0000:00:04.0 Signal processing controller [1180]: Intel Corporation TigerLake-LP Dynamic Tuning Processor Participant [8086:9a03] (rev 01) +0000:00:07.0 PCI bridge [0604]: Intel Corporation Tiger Lake-LP Thunderbolt 4 PCI Express Root Port #0 [8086:9a23] (rev 01) +0000:00:07.1 PCI bridge [0604]: Intel Corporation Tiger Lake-LP Thunderbolt 4 PCI Express Root Port #1 [8086:9a25] (rev 01) +0000:00:08.0 System peripheral [0880]: Intel Corporation GNA Scoring Accelerator module [8086:9a11] (rev 01) +0000:00:0a.0 Signal processing controller [1180]: Intel Corporation Tigerlake Telemetry Aggregator Driver [8086:9a0d] (rev 01) +0000:00:0d.0 USB controller [0c03]: Intel Corporation Tiger Lake-LP Thunderbolt 4 USB Controller [8086:9a13] (rev 01) +0000:00:0d.2 USB controller [0c03]: Intel Corporation Tiger Lake-LP Thunderbolt 4 NHI #0 [8086:9a1b] (rev 01) +0000:00:0e.0 RAID bus controller [0104]: Intel Corporation Volume Management Device NVMe RAID Controller [8086:9a0b] +0000:00:12.0 Serial controller [0700]: Intel Corporation Tiger Lake-LP Integrated Sensor Hub [8086:a0fc] (rev 20) +0000:00:14.0 USB controller [0c03]: Intel Corporation Tiger Lake-LP USB 3.2 Gen 2x1 xHCI Host Controller [8086:a0ed] (rev 20) +0000:00:14.2 RAM memory [0500]: Intel Corporation Tiger Lake-LP Shared SRAM [8086:a0ef] (rev 20) +0000:00:14.3 Network controller [0280]: Intel Corporation Wi-Fi 6 AX201 [8086:a0f0] (rev 20) +0000:00:15.0 Serial bus controller [0c80]: Intel Corporation Tiger Lake-LP Serial IO I2C Controller #0 [8086:a0e8] (rev 20) +0000:00:15.1 Serial bus controller [0c80]: Intel Corporation Tiger Lake-LP Serial IO I2C Controller #1 [8086:a0e9] (rev 20) +0000:00:16.0 Communication controller [0780]: Intel Corporation Tiger Lake-LP Management Engine Interface [8086:a0e0] (rev 20) +0000:00:1d.0 System peripheral [0880]: Intel Corporation RST VMD Managed Controller [8086:09ab] +0000:00:1f.0 ISA bridge [0601]: Intel Corporation Tiger Lake-LP LPC Controller [8086:a082] (rev 20) +0000:00:1f.3 Multimedia audio controller [0401]: Intel Corporation Tiger Lake-LP Smart Sound Technology Audio Controller [8086:a0c8] (rev 20) +0000:00:1f.4 SMBus [0c05]: Intel Corporation Tiger Lake-LP SMBus Controller [8086:a0a3] (rev 20) +0000:00:1f.5 Serial bus controller [0c80]: Intel Corporation Tiger Lake-LP SPI Controller [8086:a0a4] (rev 20) +10000:e0:1d.0 PCI bridge [0604]: Intel Corporation Tiger Lake-LP PCI Express Root Port #9 [8086:a0b0] (rev 20) +10000:e1:00.0 Non-Volatile memory controller [0108]: Sandisk Corp WD Black SN750 / PC SN730 / Red SN700 NVMe SSD [15b7:5006] +``` + +## Updating Firmware + +First enable `fwupd` in your config + +```nix +services.fwupd.enable = true; +``` + +Then run + +```bash + $ fwupdmgr update +``` diff --git a/asus/zenbook/ux371/default.nix b/asus/zenbook/ux371/default.nix new file mode 100644 index 0000000..8601e2b --- /dev/null +++ b/asus/zenbook/ux371/default.nix @@ -0,0 +1,24 @@ +{ + config, + lib, + pkgs, + inputs, + ... +}: +{ + imports = [ + ../../../common/cpu/intel/tiger-lake + ../../../common/pc/laptop + ../../../common/pc/laptop/ssd + ../../battery.nix + ]; + + boot.kernelParams = lib.mkIf (config.hardware.intelgpu.driver == "xe") [ + "i915.force_probe=!9a49" + "xe.force_probe=9a49" + ]; + + hardware.enableRedistributableFirmware = lib.mkDefault true; + services.thermald.enable = lib.mkDefault true; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; +} diff --git a/common/cpu/intel/cpu-only.nix b/common/cpu/intel/cpu-only.nix index c30f0c5..e42e90b 100644 --- a/common/cpu/intel/cpu-only.nix +++ b/common/cpu/intel/cpu-only.nix @@ -1,6 +1,4 @@ { config, lib, ... }: - { - hardware.cpu.intel.updateMicrocode = - lib.mkDefault config.hardware.enableRedistributableFirmware; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/common/cpu/intel/tiger-lake/default.nix b/common/cpu/intel/tiger-lake/default.nix new file mode 100644 index 0000000..86afdcc --- /dev/null +++ b/common/cpu/intel/tiger-lake/default.nix @@ -0,0 +1,12 @@ +{ config, lib, ... }: +{ + imports = [ ../. ]; + config = lib.mkMerge [ + (lib.mkIf (lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.8") { + hardware.intelgpu.driver = "xe"; + }) + (lib.mkIf (config.hardware.intelgpu.driver == "i915") { + boot.kernelParams = [ "i915.enable_guc=3" ]; + }) + ]; +} diff --git a/common/gpu/intel/default.nix b/common/gpu/intel/default.nix index 73591cf..91c8765 100644 --- a/common/gpu/intel/default.nix +++ b/common/gpu/intel/default.nix @@ -1,32 +1,64 @@ -{ config, lib, pkgs, ... }: - { - options.hardware.intelgpu.loadInInitrd = lib.mkEnableOption (lib.mdDoc - "loading `i195` kernelModule at stage 1. (Add `i915` to `boot.initrd.kernelModules`)" - ) // { - default = true; + config, + lib, + pkgs, + ... +}: +{ + options.hardware.intelgpu.driver = lib.mkOption { + description = "Intel GPU driver to use"; + type = lib.types.enum [ + "i915" + "xe" + ]; + default = "i915"; }; - config = lib.mkMerge [ - (lib.mkIf config.hardware.intelgpu.loadInInitrd { - boot.initrd.kernelModules = [ "i915" ]; - }) - { - environment.variables = { - VDPAU_DRIVER = lib.mkIf config.hardware.opengl.enable (lib.mkDefault "va_gl"); - }; + options.hardware.intelgpu.loadInInitrd = + lib.mkEnableOption ( + lib.mdDoc "Load the Intel GPU kernel module at stage 1 boot. (Added to `boot.initrd.kernelModules`)" + ) + // { + default = true; + }; - hardware.opengl.extraPackages = with pkgs; [ - (if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then vaapiIntel else intel-vaapi-driver) - libvdpau-va-gl - intel-media-driver - ]; + config = { + boot.initrd.kernelModules = [ config.hardware.intelgpu.driver ]; - hardware.opengl.extraPackages32 = with pkgs.driversi686Linux; [ - (if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then vaapiIntel else intel-vaapi-driver) - libvdpau-va-gl - intel-media-driver - ]; - } - ]; + environment.variables = { + VDPAU_DRIVER = lib.mkIf config.hardware.opengl.enable (lib.mkDefault "va_gl"); + }; + + hardware.opengl.extraPackages = with pkgs; [ + ( + if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then + vaapiIntel + else + intel-vaapi-driver + ) + libvdpau-va-gl + intel-media-driver + ]; + + hardware.opengl.extraPackages32 = with pkgs.driversi686Linux; [ + ( + if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then + vaapiIntel + else + intel-vaapi-driver + ) + libvdpau-va-gl + intel-media-driver + ]; + + assertions = [ + { + assertion = ( + config.hardware.intelgpu.driver != "xe" + || lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.8" + ); + message = "Intel Xe GPU driver is not supported on kernels earlier than 6.8. Update or use the i915 driver."; + } + ]; + }; } diff --git a/flake.nix b/flake.nix index 8ea11c7..9bcef07 100644 --- a/flake.nix +++ b/flake.nix @@ -24,6 +24,7 @@ asus-pro-ws-x570-ace = import ./asus/pro-ws-x570-ace; asus-rog-strix-g513im = import ./asus/rog-strix/g513im; asus-rog-strix-g733qs = import ./asus/rog-strix/g733qs; + asus-zenbook-ux371 = import ./asus/zenbook/ux371; asus-zephyrus-ga401 = import ./asus/zephyrus/ga401; asus-zephyrus-ga402 = import ./asus/zephyrus/ga402; asus-zephyrus-ga402x = import ./asus/zephyrus/ga402x; From 6d24140f51333fc5021dea0ae5faef1bd19020be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stian=20S=C3=B8rby?= <51554341+ssouthcity@users.noreply.github.com> Date: Thu, 23 May 2024 22:30:44 +0200 Subject: [PATCH 11/88] added lenovo legion 15ach6h to flake.nix --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index 9bcef07..89c1fcb 100644 --- a/flake.nix +++ b/flake.nix @@ -106,6 +106,7 @@ lenovo-ideapad-slim-5 = import ./lenovo/ideapad/slim-5; lenovo-ideapad-s145-15api = import ./lenovo/ideapad/s145-15api; lenovo-legion-15ach6 = import ./lenovo/legion/15ach6; + lenovo-legion-15ach6h = import ./lenovo/legion/15ach6h; lenovo-legion-15arh05h = import ./lenovo/legion/15arh05h; lenovo-legion-16ach6h = import ./lenovo/legion/16ach6h; lenovo-legion-16ach6h-hybrid = import ./lenovo/legion/16ach6h/hybrid; From 9a20e17a73b052d6be912adcee220cb483477094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stian=20S=C3=B8rby?= <51554341+ssouthcity@users.noreply.github.com> Date: Sun, 26 May 2024 21:53:22 +0200 Subject: [PATCH 12/88] added lenovo legion 15ach6h to README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 56fdd7a..df6e6bb 100644 --- a/README.md +++ b/README.md @@ -173,6 +173,7 @@ See code for all available configurations. | [Lenovo IdeaPad Z510](lenovo/ideapad/z510) | `` | | [Lenovo IdeaPad Slim 5](lenovo/ideapad/slim-5) | `` | | [Lenovo IdeaPad S145 15api](lenovo/ideapad/s145-15api) | `` | +| [Lenovo Legion 5 15ach6h](lenovo/legion/15ach6h) | `` | | [Lenovo Legion 5 15arh05h](lenovo/legion/15arh05h) | `` | | [Lenovo Legion 7 Slim 15ach6](lenovo/legion/15ach6) | `` | | [Lenovo Legion 5 Pro 16ach6h](lenovo/legion/16ach6h) | `` | From 413452614f52f3f5e7038f8456b6c0082a5594dc Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sat, 25 May 2024 09:31:04 -0400 Subject: [PATCH 13/88] starfive visionfive2: use mainline kernel --- starfive/visionfive/v2/default.nix | 7 +------ starfive/visionfive/v2/linux-6.6.nix | 26 -------------------------- 2 files changed, 1 insertion(+), 32 deletions(-) delete mode 100644 starfive/visionfive/v2/linux-6.6.nix diff --git a/starfive/visionfive/v2/default.nix b/starfive/visionfive/v2/default.nix index 62cfe63..afbef79 100644 --- a/starfive/visionfive/v2/default.nix +++ b/starfive/visionfive/v2/default.nix @@ -1,12 +1,7 @@ { config, lib, pkgs, ... }: { boot = { - # Force no ZFS (from nixos/modules/profiles/base.nix) until updated to kernel 6.0 - supportedFilesystems = - lib.mkForce [ "btrfs" "reiserfs" "vfat" "f2fs" "xfs" "ntfs" "cifs" ]; consoleLogLevel = lib.mkDefault 7; - kernelPackages = lib.mkDefault (pkgs.callPackage ./linux-6.6.nix { - inherit (config.boot) kernelPatches; - }); + kernelPackages = lib.mkDefault pkgs.linuxPackages_latest; kernelParams = lib.mkDefault [ "console=tty0" "console=ttyS0,115200n8" "earlycon=sbi" ]; diff --git a/starfive/visionfive/v2/linux-6.6.nix b/starfive/visionfive/v2/linux-6.6.nix deleted file mode 100644 index 5999dd6..0000000 --- a/starfive/visionfive/v2/linux-6.6.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ lib, callPackage, linuxPackagesFor, kernelPatches, ... }: - -let - modDirVersion = "6.6.0"; - linuxPkg = { lib, fetchFromGitHub, buildLinux, ... }@args: - buildLinux (args // { - version = "${modDirVersion}-starfive-visionfive2"; - - src = fetchFromGitHub { - owner = "starfive-tech"; - repo = "linux"; - rev = "13eb70da2a73187c8c7aece13d23d68928aa8210"; - hash = "sha256-bwB7Pc+Z+MWXPfWYdgtRGuhqjiNHLDGNCY62e4lBGvE="; - }; - - inherit modDirVersion kernelPatches; - - structuredExtraConfig = with lib.kernel; { - PINCTRL_STARFIVE_JH7110_SYS = yes; - SERIAL_8250_DW = yes; - }; - - extraMeta.branch = "JH7110_VisionFive2_upstream"; - } // (args.argsOverride or { })); - -in lib.recurseIntoAttrs (linuxPackagesFor (callPackage linuxPkg { })) From 03e1d2d5842a730713ab1fdbf0f25d3735019b8c Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Mon, 27 May 2024 16:37:46 -0400 Subject: [PATCH 14/88] starfive visionfive2: enable required drivers --- starfive/visionfive/v2/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/starfive/visionfive/v2/default.nix b/starfive/visionfive/v2/default.nix index afbef79..0c5ba6e 100644 --- a/starfive/visionfive/v2/default.nix +++ b/starfive/visionfive/v2/default.nix @@ -2,6 +2,15 @@ boot = { consoleLogLevel = lib.mkDefault 7; kernelPackages = lib.mkDefault pkgs.linuxPackages_latest; + kernelPatches = [{ + name = "JH7110"; + patch = pkgs.fetchpatch { + # https://patchwork.kernel.org/project/linux-riscv/patch/20240506034627.66765-1-hal.feng@starfivetech.com/ + name = "v2-riscv-defconfig-Enable-StarFive-JH7110-drivers.patch"; + url = "https://patchwork.kernel.org/series/850668/mbox/"; + hash = "sha256-81Brj61TOUoyVBxrXQh2VU3gTh/1V3uo33ic3sJPk2w="; + }; + }]; kernelParams = lib.mkDefault [ "console=tty0" "console=ttyS0,115200n8" "earlycon=sbi" ]; From a44ddc27b1180dfa1037201871d1c717e8f69372 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Mon, 27 May 2024 17:58:14 -0400 Subject: [PATCH 15/88] Revert "starfive visionfive2: Increase mtd0 to fit spl" This reverts commit 87e3122b67587492a617764f88c71991893fcf8a. --- starfive/visionfive/v2/default.nix | 5 ----- starfive/visionfive/v2/qspi-patch.dts | 17 ----------------- 2 files changed, 22 deletions(-) delete mode 100644 starfive/visionfive/v2/qspi-patch.dts diff --git a/starfive/visionfive/v2/default.nix b/starfive/visionfive/v2/default.nix index 0c5ba6e..dceca67 100644 --- a/starfive/visionfive/v2/default.nix +++ b/starfive/visionfive/v2/default.nix @@ -25,9 +25,4 @@ hardware.deviceTree.name = lib.mkDefault "starfive/jh7110-starfive-visionfive-2-v1.3b.dtb"; - - hardware.deviceTree.overlays = [{ - name = "qspi-patch"; - dtsFile = ./qspi-patch.dts; - }]; } diff --git a/starfive/visionfive/v2/qspi-patch.dts b/starfive/visionfive/v2/qspi-patch.dts deleted file mode 100644 index 6e12c98..0000000 --- a/starfive/visionfive/v2/qspi-patch.dts +++ /dev/null @@ -1,17 +0,0 @@ -/dts-v1/; -/plugin/; -/ { - compatible = "starfive,jh7110"; - fragment@0 { - target = <&qspi>; - __overlay__ { - nor_flash: flash@0 { - partitions { - spl@0 { - reg = <0x0 0x40000>; - }; - }; - }; - }; - }; -}; From d664fb04deaa8e344ce86b485a7a8d685238a4c3 Mon Sep 17 00:00:00 2001 From: xtrm Date: Tue, 28 May 2024 03:52:21 +0200 Subject: [PATCH 16/88] add Lenovo IdeaPad 3 15alc6 Signed-off-by: xtrm --- README.md | 1 + flake.nix | 1 + lenovo/ideapad/15alc6/default.nix | 11 +++++++++++ 3 files changed, 13 insertions(+) create mode 100644 lenovo/ideapad/15alc6/default.nix diff --git a/README.md b/README.md index df6e6bb..140ea0a 100644 --- a/README.md +++ b/README.md @@ -169,6 +169,7 @@ See code for all available configurations. | [Huawei Matebook X Pro (2020)](huawei/machc-wa) | `` | | [i.MX8QuadMax Multisensory Enablement Kit](nxp/imx8qm-mek/) | `` | | [Intel NUC 8i7BEH](intel/nuc/8i7beh/) | `` | +| [Lenovo IdeaPad 3 15alc6](lenovo/ideapad/15alc6) | `` | | [Lenovo IdeaPad Gaming 3 15arh05](lenovo/ideapad/15arh05) | `` | | [Lenovo IdeaPad Z510](lenovo/ideapad/z510) | `` | | [Lenovo IdeaPad Slim 5](lenovo/ideapad/slim-5) | `` | diff --git a/flake.nix b/flake.nix index 89c1fcb..c500bba 100644 --- a/flake.nix +++ b/flake.nix @@ -101,6 +101,7 @@ huawei-machc-wa = import ./huawei/machc-wa; hp-notebook-14-df0023 = import ./hp/notebook/14-df0023; intel-nuc-8i7beh = import ./intel/nuc/8i7beh; + lenovo-ideapad-15alc6 = import ./lenovo/ideapad/15alc6; lenovo-ideapad-15arh05 = import ./lenovo/ideapad/15arh05; lenovo-ideapad-z510 = import ./lenovo/ideapad/z510; lenovo-ideapad-slim-5 = import ./lenovo/ideapad/slim-5; diff --git a/lenovo/ideapad/15alc6/default.nix b/lenovo/ideapad/15alc6/default.nix new file mode 100644 index 0000000..a830c0b --- /dev/null +++ b/lenovo/ideapad/15alc6/default.nix @@ -0,0 +1,11 @@ +{ lib, ... }: + +{ + imports = [ + ../../../common/cpu/amd + ../../../common/gpu/amd + ../../../common/pc/laptop + ../../../common/pc/laptop/acpi_call.nix + ../../../common/pc/laptop/ssd + ]; +} From 806e9d4a933dd1e75592e88894d4bd2f296f5bbf Mon Sep 17 00:00:00 2001 From: xtrm Date: Tue, 28 May 2024 04:30:29 +0200 Subject: [PATCH 17/88] Fix typo for IdeaPad 3 15alc6 in README.md Signed-off-by: xtrm --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 140ea0a..1f2b827 100644 --- a/README.md +++ b/README.md @@ -169,7 +169,7 @@ See code for all available configurations. | [Huawei Matebook X Pro (2020)](huawei/machc-wa) | `` | | [i.MX8QuadMax Multisensory Enablement Kit](nxp/imx8qm-mek/) | `` | | [Intel NUC 8i7BEH](intel/nuc/8i7beh/) | `` | -| [Lenovo IdeaPad 3 15alc6](lenovo/ideapad/15alc6) | `` | +| [Lenovo IdeaPad 3 15alc6](lenovo/ideapad/15alc6) | `` | | [Lenovo IdeaPad Gaming 3 15arh05](lenovo/ideapad/15arh05) | `` | | [Lenovo IdeaPad Z510](lenovo/ideapad/z510) | `` | | [Lenovo IdeaPad Slim 5](lenovo/ideapad/slim-5) | `` | From 1e3c2a85da63a4eb6dae4fa978064e47bcdbbe74 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Tue, 28 May 2024 18:18:08 -0400 Subject: [PATCH 18/88] Revert "starfive visionfive2: enable required drivers" This reverts commit 03e1d2d5842a730713ab1fdbf0f25d3735019b8c. --- starfive/visionfive/v2/default.nix | 9 --------- 1 file changed, 9 deletions(-) diff --git a/starfive/visionfive/v2/default.nix b/starfive/visionfive/v2/default.nix index dceca67..c4a328f 100644 --- a/starfive/visionfive/v2/default.nix +++ b/starfive/visionfive/v2/default.nix @@ -2,15 +2,6 @@ boot = { consoleLogLevel = lib.mkDefault 7; kernelPackages = lib.mkDefault pkgs.linuxPackages_latest; - kernelPatches = [{ - name = "JH7110"; - patch = pkgs.fetchpatch { - # https://patchwork.kernel.org/project/linux-riscv/patch/20240506034627.66765-1-hal.feng@starfivetech.com/ - name = "v2-riscv-defconfig-Enable-StarFive-JH7110-drivers.patch"; - url = "https://patchwork.kernel.org/series/850668/mbox/"; - hash = "sha256-81Brj61TOUoyVBxrXQh2VU3gTh/1V3uo33ic3sJPk2w="; - }; - }]; kernelParams = lib.mkDefault [ "console=tty0" "console=ttyS0,115200n8" "earlycon=sbi" ]; From 9e0603134617ec23ce67e1806e905ca07abc92d3 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Tue, 28 May 2024 18:18:08 -0400 Subject: [PATCH 19/88] Revert "starfive visionfive2: use mainline kernel" This reverts commit 413452614f52f3f5e7038f8456b6c0082a5594dc. --- starfive/visionfive/v2/default.nix | 7 ++++++- starfive/visionfive/v2/linux-6.6.nix | 26 ++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 starfive/visionfive/v2/linux-6.6.nix diff --git a/starfive/visionfive/v2/default.nix b/starfive/visionfive/v2/default.nix index c4a328f..c1042e1 100644 --- a/starfive/visionfive/v2/default.nix +++ b/starfive/visionfive/v2/default.nix @@ -1,7 +1,12 @@ { config, lib, pkgs, ... }: { boot = { + # Force no ZFS (from nixos/modules/profiles/base.nix) until updated to kernel 6.0 + supportedFilesystems = + lib.mkForce [ "btrfs" "reiserfs" "vfat" "f2fs" "xfs" "ntfs" "cifs" ]; consoleLogLevel = lib.mkDefault 7; - kernelPackages = lib.mkDefault pkgs.linuxPackages_latest; + kernelPackages = lib.mkDefault (pkgs.callPackage ./linux-6.6.nix { + inherit (config.boot) kernelPatches; + }); kernelParams = lib.mkDefault [ "console=tty0" "console=ttyS0,115200n8" "earlycon=sbi" ]; diff --git a/starfive/visionfive/v2/linux-6.6.nix b/starfive/visionfive/v2/linux-6.6.nix new file mode 100644 index 0000000..5999dd6 --- /dev/null +++ b/starfive/visionfive/v2/linux-6.6.nix @@ -0,0 +1,26 @@ +{ lib, callPackage, linuxPackagesFor, kernelPatches, ... }: + +let + modDirVersion = "6.6.0"; + linuxPkg = { lib, fetchFromGitHub, buildLinux, ... }@args: + buildLinux (args // { + version = "${modDirVersion}-starfive-visionfive2"; + + src = fetchFromGitHub { + owner = "starfive-tech"; + repo = "linux"; + rev = "13eb70da2a73187c8c7aece13d23d68928aa8210"; + hash = "sha256-bwB7Pc+Z+MWXPfWYdgtRGuhqjiNHLDGNCY62e4lBGvE="; + }; + + inherit modDirVersion kernelPatches; + + structuredExtraConfig = with lib.kernel; { + PINCTRL_STARFIVE_JH7110_SYS = yes; + SERIAL_8250_DW = yes; + }; + + extraMeta.branch = "JH7110_VisionFive2_upstream"; + } // (args.argsOverride or { })); + +in lib.recurseIntoAttrs (linuxPackagesFor (callPackage linuxPkg { })) From 69fe256333b66ba6814290a0e1fda7cdba61807d Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 30 May 2024 19:58:53 -0400 Subject: [PATCH 20/88] starfive visionfive2: let u-boot set device tree name u-boot is able to automatically set the correct device tree name on VisionFive 2 boards by reading their EEPROM since v2023.10. This allows our image to work with either revision of the boards. Reference: https://github.com/u-boot/u-boot/commit/16dbe3d9d45527f67d479535a22dc4054ae93e99 --- starfive/visionfive/v2/README.md | 6 ------ starfive/visionfive/v2/default.nix | 3 --- 2 files changed, 9 deletions(-) diff --git a/starfive/visionfive/v2/README.md b/starfive/visionfive/v2/README.md index 6ec2612..1ab7918 100644 --- a/starfive/visionfive/v2/README.md +++ b/starfive/visionfive/v2/README.md @@ -56,12 +56,6 @@ nix build .# ## Additional configuration Additional configuration may be needed depending on your specific hardware configuration. -### Board rev 1.2A -If you have the 1.2A board revision add the following to your config: -``` nix -hardware.deviceTree.name = - lib.mkDefault "starfive/jh7110-starfive-visionfive-2-v1.2a.dtb"; -``` ### 8GB memory If your board has 8GB of RAM add the following to your config: diff --git a/starfive/visionfive/v2/default.nix b/starfive/visionfive/v2/default.nix index c1042e1..973db41 100644 --- a/starfive/visionfive/v2/default.nix +++ b/starfive/visionfive/v2/default.nix @@ -18,7 +18,4 @@ generic-extlinux-compatible.enable = lib.mkDefault true; }; }; - - hardware.deviceTree.name = - lib.mkDefault "starfive/jh7110-starfive-visionfive-2-v1.3b.dtb"; } From 7b49d3967613d9aacac5b340ef158d493906ba79 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 30 May 2024 20:10:18 -0400 Subject: [PATCH 21/88] starfive visionfive2: drop dtb overlay for 8GB version u-boot is able to automatically set the correct memory size in fdt on VisionFive 2 boards by reading their EEPROM since v2023.10. This allows our image to work with either variant of the boards. Reference: https://github.com/u-boot/u-boot/commit/38d900b409199df02a1a26dfcb464d4d2b6e27d2 Reference: https://github.com/u-boot/u-boot/commit/43177705ab29ed1ccca970096de1ef3c6095e7e6 --- starfive/visionfive/v2/8gb-patch.dts | 11 ----------- starfive/visionfive/v2/README.md | 13 ------------- 2 files changed, 24 deletions(-) delete mode 100644 starfive/visionfive/v2/8gb-patch.dts diff --git a/starfive/visionfive/v2/8gb-patch.dts b/starfive/visionfive/v2/8gb-patch.dts deleted file mode 100644 index 342dcba..0000000 --- a/starfive/visionfive/v2/8gb-patch.dts +++ /dev/null @@ -1,11 +0,0 @@ -/dts-v1/; -/plugin/; -/ { - compatible = "starfive,jh7110"; - fragment@0 { - target-path = "/memory@40000000"; - __overlay__ { - reg = <0x0 0x40000000 0x2 0x0>; - }; - }; -}; diff --git a/starfive/visionfive/v2/README.md b/starfive/visionfive/v2/README.md index 1ab7918..6ceb59b 100644 --- a/starfive/visionfive/v2/README.md +++ b/starfive/visionfive/v2/README.md @@ -54,19 +54,6 @@ Build the sd image. nix build .# ``` -## Additional configuration -Additional configuration may be needed depending on your specific hardware configuration. - -### 8GB memory -If your board has 8GB of RAM add the following to your config: - -``` nix -hardware.deviceTree.overlays = [{ - name = "8GB-patch"; - dtsFile = "${nixos-hardware}/starfive/visionfive/v2/8gb-patch.dts"; -}]; -``` - # Updating the bootloader ## SD-Card Install the firmware update script From 82b2e20fbffe6a5f0555701af136ad3e734a5faa Mon Sep 17 00:00:00 2001 From: V7 Date: Sat, 1 Jun 2024 17:43:46 +0530 Subject: [PATCH 22/88] Update Inspiron 5509 --- dell/inspiron/5509/default.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/dell/inspiron/5509/default.nix b/dell/inspiron/5509/default.nix index 96355a2..e77c9fd 100644 --- a/dell/inspiron/5509/default.nix +++ b/dell/inspiron/5509/default.nix @@ -1,8 +1,7 @@ { lib, ... }: { imports = [ - ../../../common/cpu/intel - ../../../common/gpu/intel + ../../../common/cpu/intel/tiger-lake ../../../common/pc/laptop ../../../common/pc/ssd ]; @@ -14,8 +13,8 @@ services.thermald.enable = lib.mkDefault true; # Touchpad - services.xserver = { - libinput.touchpad.tapping = true; - libinput.touchpad.tappingDragLock = true; + services.libinput.touchpad = { + tapping = true; + tappingDragLock = true; }; } From d6c6cf6f5fead4057d8fb2d5f30aa8ac1727f177 Mon Sep 17 00:00:00 2001 From: Cassie Cheung Date: Sat, 1 Jun 2024 14:09:40 +0800 Subject: [PATCH 23/88] apple/t2: update to kernel 6.9.2 --- apple/t2/pkgs/linux-t2.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apple/t2/pkgs/linux-t2.nix b/apple/t2/pkgs/linux-t2.nix index becf96c..e635356 100644 --- a/apple/t2/pkgs/linux-t2.nix +++ b/apple/t2/pkgs/linux-t2.nix @@ -5,11 +5,11 @@ let patchRepo = fetchFromGitHub { owner = "t2linux"; repo = "linux-t2-patches"; - rev = "8b0e51ea87f170c559c9e2f437f85367838c2fad"; - hash = "sha256-4YFaLW4WTKdFysIJHnshEaqoiKBFegnZiw4Kv88LjIA="; + rev = "48429c87a9a7fa7ea6b328da46ef1ea8725c31da"; + hash = "sha256-KK5DjQPjBq7dRCLckagxigyHlRtantJ51bnHFCLfbxU="; }; - version = "6.9"; + version = "6.9.2"; majorVersion = with lib; (elemAt (take 1 (splitVersion version)) 0); in buildLinux (args // { @@ -22,7 +22,7 @@ buildLinux (args // { src = runCommand "patched-source" {} '' cp -r ${fetchzip { url = "mirror://kernel/linux/kernel/v${majorVersion}.x/linux-${version}.tar.xz"; - hash = "sha256-RIxLyvF5kw/to8MjAUq2iQ4X0bGk7FY+ovE3zd0eKxM="; + hash = "sha256-8SyfBmjLSWsBPvboCMh4qBAjaQ7yPT+AvMd3FTeYzMM="; }} $out chmod -R u+w $out cd $out From 057a7996d012f342a38a26261ee529cebb1755ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sat, 8 Jun 2024 08:12:26 +0200 Subject: [PATCH 24/88] hidpi: drop legacy options --- common/hidpi.nix | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/common/hidpi.nix b/common/hidpi.nix index 1b03085..85b167c 100644 --- a/common/hidpi.nix +++ b/common/hidpi.nix @@ -1,12 +1,6 @@ { lib, pkgs, ... }: -let - # This option is removed from NixOS 23.05 and up - nixosVersion = lib.versions.majorMinor lib.version; - config = if lib.versionOlder nixosVersion "23.05" then { - hardware.video.hidpi.enable = lib.mkDefault true; - } else { - # Just set the console font, don't mess with the font settings - console.font = lib.mkDefault "${pkgs.terminus_font}/share/consolefonts/ter-v32n.psf.gz"; - console.earlySetup = lib.mkDefault true; - }; -in config +{ + # Just set the console font, don't mess with the font settings + console.font = lib.mkDefault "${pkgs.terminus_font}/share/consolefonts/ter-v32n.psf.gz"; + console.earlySetup = lib.mkDefault true; +} From 35f2177d6656b4db8797f4dbb0f9a70e34fbbc8f Mon Sep 17 00:00:00 2001 From: Cassie Cheung Date: Sun, 9 Jun 2024 22:48:25 +0800 Subject: [PATCH 25/88] apple/t2: update to kernel 6.9.3 * also updates the patches kernel to include the apfs module --- apple/t2/pkgs/linux-t2.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apple/t2/pkgs/linux-t2.nix b/apple/t2/pkgs/linux-t2.nix index e635356..beff7a3 100644 --- a/apple/t2/pkgs/linux-t2.nix +++ b/apple/t2/pkgs/linux-t2.nix @@ -5,11 +5,11 @@ let patchRepo = fetchFromGitHub { owner = "t2linux"; repo = "linux-t2-patches"; - rev = "48429c87a9a7fa7ea6b328da46ef1ea8725c31da"; - hash = "sha256-KK5DjQPjBq7dRCLckagxigyHlRtantJ51bnHFCLfbxU="; + rev = "33d5a01c41f140a416a7f840cc06e7f30dc58d8d"; + hash = "sha256-wx5jkOQ8l/4XRGLV9KFrxXuqunwcFA9RB1yhrtseP2A="; }; - version = "6.9.2"; + version = "6.9.3"; majorVersion = with lib; (elemAt (take 1 (splitVersion version)) 0); in buildLinux (args // { @@ -22,7 +22,7 @@ buildLinux (args // { src = runCommand "patched-source" {} '' cp -r ${fetchzip { url = "mirror://kernel/linux/kernel/v${majorVersion}.x/linux-${version}.tar.xz"; - hash = "sha256-8SyfBmjLSWsBPvboCMh4qBAjaQ7yPT+AvMd3FTeYzMM="; + hash = "sha256-7262WHO2veIn+9cd4m9io1ov93LsfpgRKfmvBx0DCBA="; }} $out chmod -R u+w $out cd $out @@ -35,6 +35,7 @@ buildLinux (args // { structuredExtraConfig = with lib.kernel; { APPLE_BCE = module; APPLE_GMUX = module; + APFS_FS = module; BRCMFMAC = module; BT_BCM = module; BT_HCIBCM4377 = module; From 58b52b0dd191af70f538c707c66c682331cfdffc Mon Sep 17 00:00:00 2001 From: Arthur Rump Date: Sat, 13 Jan 2024 21:04:53 +0100 Subject: [PATCH 26/88] Add configuration for Lenovo IdeaPad 5 Pro 16ACH6 --- README.md | 1 + flake.nix | 1 + lenovo/ideapad/16ach6/README.md | 41 +++++++++++++++++++++++++++++++ lenovo/ideapad/16ach6/default.nix | 20 +++++++++++++++ 4 files changed, 63 insertions(+) create mode 100644 lenovo/ideapad/16ach6/README.md create mode 100644 lenovo/ideapad/16ach6/default.nix diff --git a/README.md b/README.md index 1f2b827..dd551b4 100644 --- a/README.md +++ b/README.md @@ -171,6 +171,7 @@ See code for all available configurations. | [Intel NUC 8i7BEH](intel/nuc/8i7beh/) | `` | | [Lenovo IdeaPad 3 15alc6](lenovo/ideapad/15alc6) | `` | | [Lenovo IdeaPad Gaming 3 15arh05](lenovo/ideapad/15arh05) | `` | +| [Lenovo IdeaPad 5 Pro 16ach6](lenovo/ideapad/16ach6) | `` | | [Lenovo IdeaPad Z510](lenovo/ideapad/z510) | `` | | [Lenovo IdeaPad Slim 5](lenovo/ideapad/slim-5) | `` | | [Lenovo IdeaPad S145 15api](lenovo/ideapad/s145-15api) | `` | diff --git a/flake.nix b/flake.nix index c500bba..16d0fe7 100644 --- a/flake.nix +++ b/flake.nix @@ -103,6 +103,7 @@ intel-nuc-8i7beh = import ./intel/nuc/8i7beh; lenovo-ideapad-15alc6 = import ./lenovo/ideapad/15alc6; lenovo-ideapad-15arh05 = import ./lenovo/ideapad/15arh05; + lenovo-ideapad-16ach6 = import ./lenovo/ideapad/16ach6; lenovo-ideapad-z510 = import ./lenovo/ideapad/z510; lenovo-ideapad-slim-5 = import ./lenovo/ideapad/slim-5; lenovo-ideapad-s145-15api = import ./lenovo/ideapad/s145-15api; diff --git a/lenovo/ideapad/16ach6/README.md b/lenovo/ideapad/16ach6/README.md new file mode 100644 index 0000000..d3447eb --- /dev/null +++ b/lenovo/ideapad/16ach6/README.md @@ -0,0 +1,41 @@ +# Lenovo IdeaPad 5 Pro 16ACH6 + +This laptop comes with an AMD CPU+GPU and dedicated NVIDIA graphics. Unlike the similarly named [Legion 5 Pro 16ACH6*H*](../../legion/16ach6h/), there is no direct dedicated graphics setting. + +The `nvidia.hardware.powerManagement.enable` option is not enabled in this configuration, since it seemed to cause issues when waking up from suspend, while also not providing much in terms of power saving. I've tested with `finegrained` both enabled and disabled, and it caused the screen to go dark a few moments after waking up from suspend. Most times this only happened once and the screen came back after a few moments, but on some occasions it kept occurring repeatedly. + +This device also has a "battery conservation mode", which charges the battery to only ~60%. This mode can be enabled using [TLP](https://linrunner.de/tlp/settings/bc-vendors.html#lenovo-non-thinkpad-series): + +```nix +services.power-profiles-daemon.enable = false; +services.tlp.enable = true; +services.tlp.settings = { + # Enable battery conservation mode + # Run `sudo tlp fullcharge` to enable a full charge until next reboot, + # and `sudo tlp setcharge` to reset to conservation mode. + START_CHARGE_THRESH_BAT0 = 0; + STOP_CHARGE_THRESH_BAT0 = 1; +}; +``` + +## Device information + +Details from `tlp-stat`: + +``` +System = LENOVO IdeaPad 5 Pro 16ACH6 82L5 +BIOS = GSCN35WW +EC Firmware = 1.35 +OS Release = NixOS 23.11 (Tapir) +Kernel = 6.6.10 #1-NixOS SMP PREEMPT_DYNAMIC Fri Jan 5 14:19:45 UTC 2024 x86_64 +Init system = systemd +Boot mode = UEFI +Suspend mode = [s2idle] +``` + +`lspci` output: + +``` +01:00.0 3D controller: NVIDIA Corporation GA107M [GeForce RTX 3050 Mobile] (rev a1) +05:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Cezanne [Radeon Vega Series / Radeon Vega Mobile Series] (rev c4) +``` diff --git a/lenovo/ideapad/16ach6/default.nix b/lenovo/ideapad/16ach6/default.nix new file mode 100644 index 0000000..3f9beb1 --- /dev/null +++ b/lenovo/ideapad/16ach6/default.nix @@ -0,0 +1,20 @@ +{ lib, ... }: + +{ + imports = [ + ../../../common/cpu/amd + ../../../common/cpu/amd/pstate.nix + ../../../common/gpu/amd + ../../../common/gpu/nvidia/prime.nix + ../../../common/pc/laptop + ../../../common/pc/laptop/ssd + ]; + + hardware.nvidia = { + modesetting.enable = true; + prime = { + amdgpuBusId = "PCI:5:0:0"; + nvidiaBusId = "PCI:1:0:0"; + }; + }; +} From 7e148208c45511054e2f7ae6212863ae2e0eb299 Mon Sep 17 00:00:00 2001 From: Sophie Tauchert Date: Wed, 5 Jun 2024 23:13:35 +0200 Subject: [PATCH 27/88] purism librem5r4: linuxPackages_librem5: 6.6.6-librem5 -> 6.6.29-librem5 --- purism/librem/5r4/kernel.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/purism/librem/5r4/kernel.nix b/purism/librem/5r4/kernel.nix index 28f5958..f348ff3 100644 --- a/purism/librem/5r4/kernel.nix +++ b/purism/librem/5r4/kernel.nix @@ -6,14 +6,14 @@ buildLinux (args // rec { defconfig = "librem5_defconfig"; - version = "6.6.6-librem5"; + version = "6.6.29-librem5"; modDirVersion = version; src = fetchFromGitLab { domain = "source.puri.sm"; owner = "Librem5"; repo = "linux"; - rev = "pureos/6.6.6pureos1"; - hash = "sha256-LJfY45yNYgFYLCGxb+WRMYBUHnY4HCI2rkflPeaeFe0="; + rev = "pureos/6.6.29pureos1"; + hash = "sha256-i8HSAJ1/Z2Ux2s3Srse+L0S1Zd/70ldpGBhIgEZ6nBw="; }; kernelPatches = [ ]; structuredExtraConfig = with lib.kernel; { From 624f88c6c0905829b02355839989c134143e6789 Mon Sep 17 00:00:00 2001 From: Sophie Tauchert Date: Thu, 6 Jun 2024 10:43:08 +0200 Subject: [PATCH 28/88] purism librem5r4: fix uboot build --- purism/librem/5r4/u-boot/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/purism/librem/5r4/u-boot/default.nix b/purism/librem/5r4/u-boot/default.nix index 26c217c..a6b00a7 100644 --- a/purism/librem/5r4/u-boot/default.nix +++ b/purism/librem/5r4/u-boot/default.nix @@ -51,6 +51,7 @@ let rev = "956aa590c93977992743b41c45d3c7ee5a024915"; # this is the latest commit on the upstream/librem5 branch hash = "sha256-MsIIlarN+WFFEzc0ptLAgS7BwJ6Cosy42xo0EwPn1AU="; }; + patches = []; BL31 = "${arm-trusted-firmware-imx8mq}/bl31.bin"; preConfigure = '' cp $BL31 . From 3b5f843e923ac20ea32ce398cfb7f0b8967d75ea Mon Sep 17 00:00:00 2001 From: Glenn McDonald <2371316+glenn-m@users.noreply.github.com> Date: Tue, 11 Jun 2024 00:44:19 -0400 Subject: [PATCH 29/88] Add Chuwi MiniBook X --- README.md | 1 + chuwi/minibook-x/default.nix | 10 ++++++++++ flake.nix | 1 + 3 files changed, 12 insertions(+) create mode 100644 chuwi/minibook-x/default.nix diff --git a/README.md b/README.md index dd551b4..906ab7e 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,7 @@ See code for all available configurations. | [Asus TUF FA507NV](asus/fa507nv) | `` | | [Asus Zenbook Flip S13 UX371](asus/zenbook/ux371/) | `` | | [BeagleBoard PocketBeagle](beagleboard/pocketbeagle) | `` | +| [Chuwi MiniBook X](chuwi/minibook-x) | `` | | [Deciso DEC series](deciso/dec) | `` | | [Dell G3 3779](dell/g3/3779) | `` | | [Dell Inspiron 14 5420](dell/inspiron/14-5420) | `` | diff --git a/chuwi/minibook-x/default.nix b/chuwi/minibook-x/default.nix new file mode 100644 index 0000000..d35c86f --- /dev/null +++ b/chuwi/minibook-x/default.nix @@ -0,0 +1,10 @@ +{ ... }: { + imports = [ + ../../common/cpu/intel + ../../common/pc/laptop + ../../common/pc/laptop/ssd + ../../common/hidpi.nix + ]; + boot.kernelParams = + [ "fbcon=rotate:1" "video=DSI-1:panel_orientation=right_side_up" ]; +} diff --git a/flake.nix b/flake.nix index 16d0fe7..3f69744 100644 --- a/flake.nix +++ b/flake.nix @@ -32,6 +32,7 @@ asus-zephyrus-ga503 = import ./asus/zephyrus/ga503; asus-zephyrus-gu603h = import ./asus/zephyrus/gu603h; beagleboard-pocketbeagle = import ./beagleboard/pocketbeagle; + chuwi-minibook-x = import ./chuwi/minibook-x; deciso-dec = import ./deciso/dec; dell-e7240 = import ./dell/e7240; dell-g3-3779 = import ./dell/g3/3779; From 43e369c6d57ea78632147ed1cd2ffc8ac54d97c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 11 Jun 2024 11:06:17 +0200 Subject: [PATCH 30/88] chuwi/minibook-x: add comment why we specify kernelParams --- chuwi/minibook-x/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/chuwi/minibook-x/default.nix b/chuwi/minibook-x/default.nix index d35c86f..39bc9cc 100644 --- a/chuwi/minibook-x/default.nix +++ b/chuwi/minibook-x/default.nix @@ -5,6 +5,7 @@ ../../common/pc/laptop/ssd ../../common/hidpi.nix ]; + # Fixes the display being rotated 90 degrees. boot.kernelParams = [ "fbcon=rotate:1" "video=DSI-1:panel_orientation=right_side_up" ]; } From 7738cb40f6a42e2bb398f07964d1df53a683d27e Mon Sep 17 00:00:00 2001 From: Stig Palmquist Date: Mon, 10 Jun 2024 22:23:59 +0200 Subject: [PATCH 31/88] surface: linux-surface arch-6.8.6-1 -> arch-6.9.3-1 --- microsoft/surface/common/repos.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/microsoft/surface/common/repos.nix b/microsoft/surface/common/repos.nix index 321e729..313f133 100644 --- a/microsoft/surface/common/repos.nix +++ b/microsoft/surface/common/repos.nix @@ -4,8 +4,8 @@ linux-surface = fetchFromGitHub { owner = "linux-surface"; repo = "linux-surface"; - rev = "arch-6.8.6-1"; - hash = "sha256-kLnHcYFeQ7/8lbSL4p9D2aC4V/Ib1tU225UOkRcNnH4="; + rev = "arch-6.9.3-1"; + hash = "sha256-HoG7MuWAtiTAX9CJeqCGrfkfoue7XLtSMF6zjx4z7i8="; }; # This is the owner and repo for the pre-patched kernel from the "linux-surface" project: From 5ca7d128e6d8e6bd8ac59aa8af0486915d40771e Mon Sep 17 00:00:00 2001 From: Stig Palmquist Date: Mon, 10 Jun 2024 22:24:42 +0200 Subject: [PATCH 32/88] surface: linux 6.8.9 -> 6.9.3 --- microsoft/surface/common/kernel/default.nix | 2 +- .../{linux-6.8.x => linux-6.9.x}/default.nix | 4 +- .../{linux-6.8.x => linux-6.9.x}/patches.nix | 60 ++++++++++--------- 3 files changed, 35 insertions(+), 31 deletions(-) rename microsoft/surface/common/kernel/{linux-6.8.x => linux-6.9.x}/default.nix (87%) rename microsoft/surface/common/kernel/{linux-6.8.x => linux-6.9.x}/patches.nix (61%) diff --git a/microsoft/surface/common/kernel/default.nix b/microsoft/surface/common/kernel/default.nix index 0c0159a..a8f598d 100644 --- a/microsoft/surface/common/kernel/default.nix +++ b/microsoft/surface/common/kernel/default.nix @@ -5,7 +5,7 @@ let in { imports = [ - ./linux-6.8.x + ./linux-6.9.x ]; options.microsoft-surface.kernelVersion = mkOption { diff --git a/microsoft/surface/common/kernel/linux-6.8.x/default.nix b/microsoft/surface/common/kernel/linux-6.9.x/default.nix similarity index 87% rename from microsoft/surface/common/kernel/linux-6.8.x/default.nix rename to microsoft/surface/common/kernel/linux-6.9.x/default.nix index e016d77..c0fd5c9 100644 --- a/microsoft/surface/common/kernel/linux-6.8.x/default.nix +++ b/microsoft/surface/common/kernel/linux-6.9.x/default.nix @@ -7,14 +7,14 @@ let cfg = config.microsoft-surface; - version = "6.8.9"; + version = "6.9.3"; kernelPatches = surfacePatches { inherit version; patchFn = ./patches.nix; }; kernelPackages = linuxPackage { inherit version kernelPatches; - sha256 = "sha256-+QXxI46nqOhTFLrPKDMC6AlwBgENJfzqcm0N4OpbybY="; + sha256 = "1bnzxparybwh320019pr2msaapas41dhjmvg4gy791rn05jc88f3"; ignoreConfigErrors=true; }; diff --git a/microsoft/surface/common/kernel/linux-6.8.x/patches.nix b/microsoft/surface/common/kernel/linux-6.9.x/patches.nix similarity index 61% rename from microsoft/surface/common/kernel/linux-6.8.x/patches.nix rename to microsoft/surface/common/kernel/linux-6.9.x/patches.nix index 353764b..9590b9e 100644 --- a/microsoft/surface/common/kernel/linux-6.8.x/patches.nix +++ b/microsoft/surface/common/kernel/linux-6.9.x/patches.nix @@ -86,59 +86,63 @@ }; } { - name = "ms-surface/0001-surface3-oemb"; - patch = patchSrc + "/0001-surface3-oemb.patch"; + name = "ms-surface/0001-secureboot"; + patch = patchSrc + "/0001-secureboot.patch"; } { - name = "ms-surface/0002-mwifiex"; - patch = patchSrc + "/0002-mwifiex.patch"; + name = "ms-surface/0002-surface3-oemb"; + patch = patchSrc + "/0002-surface3-oemb.patch"; } { - name = "ms-surface/0003-ath10k"; - patch = patchSrc + "/0003-ath10k.patch"; + name = "ms-surface/0003-mwifiex"; + patch = patchSrc + "/0003-mwifiex.patch"; } { - name = "ms-surface/0004-ipts"; - patch = patchSrc + "/0004-ipts.patch"; + name = "ms-surface/0004-ath10k"; + patch = patchSrc + "/0004-ath10k.patch"; } { - name = "ms-surface/0005-ithc"; - patch = patchSrc + "/0005-ithc.patch"; + name = "ms-surface/0005-ipts"; + patch = patchSrc + "/0005-ipts.patch"; } { - name = "ms-surface/0006-surface-sam"; - patch = patchSrc + "/0006-surface-sam.patch"; + name = "ms-surface/0006-ithc"; + patch = patchSrc + "/0006-ithc.patch"; } { - name = "ms-surface/0007-surface-sam-over-hid"; - patch = patchSrc + "/0007-surface-sam-over-hid.patch"; + name = "ms-surface/0007-surface-sam"; + patch = patchSrc + "/0007-surface-sam.patch"; } { - name = "ms-surface/0008-surface-button"; - patch = patchSrc + "/0008-surface-button.patch"; + name = "ms-surface/0008-surface-sam-over-hid"; + patch = patchSrc + "/0008-surface-sam-over-hid.patch"; } { - name = "ms-surface/0009-surface-typecover"; - patch = patchSrc + "/0009-surface-typecover.patch"; + name = "ms-surface/0009-surface-button"; + patch = patchSrc + "/0009-surface-button.patch"; } { - name = "ms-surface/0010-surface-shutdown"; - patch = patchSrc + "/0010-surface-shutdown.patch"; + name = "ms-surface/0010-surface-typecover"; + patch = patchSrc + "/0010-surface-typecover.patch"; } { - name = "ms-surface/0011-surface-gpe"; - patch = patchSrc + "/0011-surface-gpe.patch"; + name = "ms-surface/0011-surface-shutdown"; + patch = patchSrc + "/0011-surface-shutdown.patch"; } { - name = "ms-surface/0012-cameras"; - patch = patchSrc + "/0012-cameras.patch"; + name = "ms-surface/0012-surface-gpe"; + patch = patchSrc + "/0012-surface-gpe.patch"; } { - name = "ms-surface/0013-amd-gpio"; - patch = patchSrc + "/0013-amd-gpio.patch"; + name = "ms-surface/0013-cameras"; + patch = patchSrc + "/0013-cameras.patch"; } { - name = "ms-surface/0014-rtc"; - patch = patchSrc + "/0014-rtc.patch"; + name = "ms-surface/0014-amd-gpio"; + patch = patchSrc + "/0014-amd-gpio.patch"; + } + { + name = "ms-surface/0015-rtc"; + patch = patchSrc + "/0015-rtc.patch"; } ] From f17f79c796381b93e13a6d83580be780da8f9697 Mon Sep 17 00:00:00 2001 From: Brieuc Dubois Date: Mon, 10 Jun 2024 15:40:56 +0200 Subject: [PATCH 33/88] rpi4: bluetooth fix --- raspberry-pi/4/bluetooth.nix | 44 ++++++++++++++++++++++++++++++++++++ raspberry-pi/4/default.nix | 1 + 2 files changed, 45 insertions(+) create mode 100644 raspberry-pi/4/bluetooth.nix diff --git a/raspberry-pi/4/bluetooth.nix b/raspberry-pi/4/bluetooth.nix new file mode 100644 index 0000000..78619bc --- /dev/null +++ b/raspberry-pi/4/bluetooth.nix @@ -0,0 +1,44 @@ +{ config, lib, ... }: + +let + cfg = config.hardware.raspberry-pi."4".bluetooth; +in +{ + options.hardware = { + raspberry-pi."4".bluetooth = { + enable = lib.mkEnableOption '' + configuration for bluetooth + ''; + }; + }; + + config = lib.mkIf cfg.enable { + hardware.raspberry-pi."4".apply-overlays-dtmerge.enable = lib.mkDefault true; + # doesn't work for the CM module, so we exclude e.g. bcm2711-rpi-cm4.dts + hardware.deviceTree.filter = "bcm2711-rpi-4*.dtb"; + + hardware.deviceTree = { + overlays = [ + { + name = "bluetooth-overlay"; + dtsText = '' + /dts-v1/; + /plugin/; + + / { + compatible = "brcm,bcm2711"; + + fragment@0 { + target = <&uart0_pins>; + __overlay__ { + brcm,pins = <30 31 32 33>; + brcm,pull = <2 0 0 2>; + }; + }; + }; + ''; + } + ]; + }; + }; +} diff --git a/raspberry-pi/4/default.nix b/raspberry-pi/4/default.nix index 41d065a..a2739d7 100644 --- a/raspberry-pi/4/default.nix +++ b/raspberry-pi/4/default.nix @@ -4,6 +4,7 @@ imports = [ ./audio.nix ./backlight.nix + ./bluetooth.nix ./cpu-revision.nix ./digi-amp-plus.nix ./dwc2.nix From 9e848e173ca83adf884815c66edc08652ef9ade8 Mon Sep 17 00:00:00 2001 From: Jan Heidbrink Date: Fri, 7 Jun 2024 18:30:13 +0200 Subject: [PATCH 34/88] add Dell Latitude 9430 --- README.md | 1 + dell/latitude/9430/default.nix | 19 +++++++++++++++++++ flake.nix | 1 + 3 files changed, 21 insertions(+) create mode 100644 dell/latitude/9430/default.nix diff --git a/README.md b/README.md index 906ab7e..a71f521 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,7 @@ See code for all available configurations. | [Dell Latitude 7390](dell/latitude/7390) | `` | | [Dell Latitude 7430](dell/latitude/7430) | `` | | [Dell Latitude 7490](dell/latitude/7490) | `` | +| [Dell Latitude 9430](dell/latitude/9430) | `` | | [Dell Poweredge R7515](dell/poweredge/r7515) | `` | | [Dell Precision 3541](dell/precision/3541) | `` | | [Dell Precision 5530](dell/precision/5530) | `` | diff --git a/dell/latitude/9430/default.nix b/dell/latitude/9430/default.nix new file mode 100644 index 0000000..f652e9a --- /dev/null +++ b/dell/latitude/9430/default.nix @@ -0,0 +1,19 @@ +{ lib, ... }: + +{ + imports = [ + ../../../common/cpu/intel + ../../../common/pc/laptop + ../../../common/pc/laptop/ssd + ]; + + boot.kernelParams = [ + # See https://discourse.nixos.org/t/i915-driver-has-bug-for-iris-xe-graphics/25006/12 + # jheidbrink reports that without this setting there is a very high lag in Sway which makes it unusable + "i915.enable_psr=0" + ]; + + # Make the webcam work (needs Linux >= 6.6): + hardware.ipu6.enable = true; + hardware.ipu6.platform = "ipu6ep"; +} diff --git a/flake.nix b/flake.nix index 3f69744..7ff195c 100644 --- a/flake.nix +++ b/flake.nix @@ -47,6 +47,7 @@ dell-latitude-7390 = import ./dell/latitude/7390; dell-latitude-7430 = import ./dell/latitude/7430; dell-latitude-7490 = import ./dell/latitude/7490; + dell-latitude-9430 = import ./dell/latitude/9430; dell-poweredge-r7515 = import ./dell/poweredge/r7515; dell-precision-3541 = import ./dell/precision/3541; dell-precision-5530 = import ./dell/precision/5530; From 291c3ee610d94e39fa40f1051ebb14b56a57a5d9 Mon Sep 17 00:00:00 2001 From: K900 Date: Thu, 13 Jun 2024 09:51:03 +0300 Subject: [PATCH 35/88] treewide: drop hardware.amdgpu.amdvlk option This is now provided in nixpkgs (see https://github.com/NixOS/nixpkgs/pull/318175). --- common/gpu/amd/default.nix | 12 ------------ lenovo/legion/15ach6h/nvidia/default.nix | 15 +++------------ lenovo/legion/16ach6h/nvidia/default.nix | 15 +++------------ lenovo/legion/16achg6/nvidia/default.nix | 7 ++----- 4 files changed, 8 insertions(+), 41 deletions(-) diff --git a/common/gpu/amd/default.nix b/common/gpu/amd/default.nix index 1347e82..26cd833 100644 --- a/common/gpu/amd/default.nix +++ b/common/gpu/amd/default.nix @@ -6,9 +6,6 @@ ) // { default = true; }; - options.hardware.amdgpu.amdvlk = lib.mkEnableOption (lib.mdDoc - "use amdvlk drivers instead mesa radv drivers" - ); options.hardware.amdgpu.opencl = lib.mkEnableOption (lib.mdDoc "rocm opencl runtime (Install rocmPackages.clr and rocmPackages.clr.icd)" ) // { @@ -27,15 +24,6 @@ (lib.mkIf config.hardware.amdgpu.loadInInitrd { boot.initrd.kernelModules = [ "amdgpu" ]; }) - (lib.mkIf config.hardware.amdgpu.amdvlk { - hardware.opengl.extraPackages = with pkgs; [ - amdvlk - ]; - - hardware.opengl.extraPackages32 = with pkgs; [ - driversi686Linux.amdvlk - ]; - }) (lib.mkIf config.hardware.amdgpu.opencl { hardware.opengl.extraPackages = if pkgs ? rocmPackages.clr diff --git a/lenovo/legion/15ach6h/nvidia/default.nix b/lenovo/legion/15ach6h/nvidia/default.nix index 31de5c1..ad62415 100644 --- a/lenovo/legion/15ach6h/nvidia/default.nix +++ b/lenovo/legion/15ach6h/nvidia/default.nix @@ -9,18 +9,9 @@ # because when writing the specialization of Dual-Direct GFX, I did not completely # remove all packages for amd igpu. I only removed amdgpu from # services.xserver.videoDrivers by overriding. This is because the specialization - # of nix cannot implement such an operation as canceling an import. In the end, if - # it is enabled in Dual-Direct GFX In the absence of amd igpu, the amdvlk package - # caused the proton to crash. In order to solve this problem, I add the option of - # whether to enable amdvlk to the configuration file of amd gpu, and open it by - # default, and turn it off in specialization, so as to delete amdvlk package and - # other packages for amd igpu in specialization. At the same time, I also added an - # option to amdgpu's opencl runtime. + # of nix cannot implement such an operation as canceling an import. hardware = { nvidia.prime.offload.enable = false; - amdgpu = { - amdvlk = false; - opencl = false; - }; + amdgpu.opencl = false; }; -} \ No newline at end of file +} diff --git a/lenovo/legion/16ach6h/nvidia/default.nix b/lenovo/legion/16ach6h/nvidia/default.nix index 31de5c1..ad62415 100644 --- a/lenovo/legion/16ach6h/nvidia/default.nix +++ b/lenovo/legion/16ach6h/nvidia/default.nix @@ -9,18 +9,9 @@ # because when writing the specialization of Dual-Direct GFX, I did not completely # remove all packages for amd igpu. I only removed amdgpu from # services.xserver.videoDrivers by overriding. This is because the specialization - # of nix cannot implement such an operation as canceling an import. In the end, if - # it is enabled in Dual-Direct GFX In the absence of amd igpu, the amdvlk package - # caused the proton to crash. In order to solve this problem, I add the option of - # whether to enable amdvlk to the configuration file of amd gpu, and open it by - # default, and turn it off in specialization, so as to delete amdvlk package and - # other packages for amd igpu in specialization. At the same time, I also added an - # option to amdgpu's opencl runtime. + # of nix cannot implement such an operation as canceling an import. hardware = { nvidia.prime.offload.enable = false; - amdgpu = { - amdvlk = false; - opencl = false; - }; + amdgpu.opencl = false; }; -} \ No newline at end of file +} diff --git a/lenovo/legion/16achg6/nvidia/default.nix b/lenovo/legion/16achg6/nvidia/default.nix index af0f2d6..aa292cd 100644 --- a/lenovo/legion/16achg6/nvidia/default.nix +++ b/lenovo/legion/16achg6/nvidia/default.nix @@ -5,9 +5,6 @@ services.xserver.videoDrivers = [ "nvidia" ]; hardware = { nvidia.prime.offload.enable = false; - amdgpu = { - amdvlk = false; - opencl = false; - }; + amdgpu.opencl = false; }; -} \ No newline at end of file +} From d75003136c0fc94ee60e51806c2801ff572d06a6 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Wed, 12 Jun 2024 20:43:24 +0200 Subject: [PATCH 36/88] framework: Better firmware update instructions and troubleshooting --- framework/README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/framework/README.md b/framework/README.md index 2dd58aa..4adaefb 100644 --- a/framework/README.md +++ b/framework/README.md @@ -13,12 +13,38 @@ First put enable `fwupd` services.fwupd.enable = true; ``` +> [!Note] +> For Intel CPU's, even [stable BIOS versions](https://community.frame.work/t/responded-11th-gen-intel-core-bios-3-17-release/25137#update-april-11-2023-2) are currently marked as [test versions](https://fwupd.org/lvfs/devices/work.frame.Laptop.TGL.BIOS.firmware) in LVFS (the default remote fwupd uses to get firmware). +> +> If you want to use these versions, you'll have to [explicitly enable the lvfs-testing remote](https://community.frame.work/t/responded-11th-gen-intel-core-bios-3-17-release/25137#linuxlvfs-7): +> +> ```nix +> services.fwupd.extraRemotes = [ "lvfs-testing" ]; +> # Might be necessary once to make the update succeed +> services.fwupd.uefiCapsuleSettings.DisableCapsuleUpdateOnDisk = true; +> ``` + +> [!Caution] +> Before running the update, make sure you have a [NixOS live ISO](https://nixos.org/download/#nixos-iso) on a USB stick, because some firmware updates [make your system unbootable](https://community.frame.work/t/drive-not-bootable-after-bios-update/12887). + Then run ```sh $ fwupdmgr update ``` +If you cannot boot into your system after upgrading: +1. Boot into the live USB +2. Mount your system into `/mnt` +3. Run + ``` + sudo nixos-enter + ``` +4. Run + ``` + NIXOS_INSTALL_BOOTLOADER=1 /run/current-system/bin/switch-to-configuration boot + ``` + ## Common Modules For the Framework 13 laptops, there are common configuration modules available under the `13-inch/common/` directory, From 62d41cb488e1a83b94c84800043b13c135f9b959 Mon Sep 17 00:00:00 2001 From: xunuwu Date: Fri, 14 Jun 2024 08:30:32 +0200 Subject: [PATCH 37/88] add gigabyte-b550 to flake outputs --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index 7ff195c..b203958 100644 --- a/flake.nix +++ b/flake.nix @@ -89,6 +89,7 @@ friendlyarm-nanopc-t4 = import ./friendlyarm/nanopc-t4; friendlyarm-nanopi-r5s = import ./friendlyarm/nanopi-r5s; focus-m2-gen1 = import ./focus/m2/gen1; + gigabyte-b550 = import ./gigabyte/b550; google-pixelbook = import ./google/pixelbook; gpd-micropc = import ./gpd/micropc; gpd-p2-max = import ./gpd/p2-max; From ae5c8dcc4d0182d07d75df2dc97112de822cb9d6 Mon Sep 17 00:00:00 2001 From: xunuwu Date: Fri, 14 Jun 2024 08:51:59 +0200 Subject: [PATCH 38/88] fix unbalanced quoting --- gigabyte/b550/b550-fix-suspend.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gigabyte/b550/b550-fix-suspend.nix b/gigabyte/b550/b550-fix-suspend.nix index 0e922a8..4986809 100644 --- a/gigabyte/b550/b550-fix-suspend.nix +++ b/gigabyte/b550/b550-fix-suspend.nix @@ -26,7 +26,7 @@ }; serviceConfig = { User = "root"; - ExecStart = "-${pkgs.bash}/bin/bash -c 'if grep 'GPP8' /proc/acpi/wakeup | grep -q 'enabled'; then echo 'GPP8' > /proc/acpi/wakeup; fi''"; + ExecStart = "-${pkgs.bash}/bin/bash -c 'if grep 'GPP8' /proc/acpi/wakeup | grep -q 'enabled'; then echo 'GPP8' > /proc/acpi/wakeup; fi'"; RemainAfterExit = "yes"; }; wantedBy = ["multi-user.target"]; From 0cd562157274df3783840bdcb0ce6d9c4cf4aa29 Mon Sep 17 00:00:00 2001 From: John Titor <50095635+JohnRTitor@users.noreply.github.com> Date: Sat, 15 Jun 2024 18:52:13 +0530 Subject: [PATCH 39/88] amd/cpu/raphael-igpu: enable scatter/gather for kernel 6.6+ Scatter/gather was introduced in 6.2 kernel and caused flickering and various issues when running iGPU on Ryzen 7000-series CPUs. This issue is not observed in kernel 6.6 or newer versions so we can enable it for kernel 6.6 and newer versions. --- common/cpu/amd/raphael/igpu.nix | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/common/cpu/amd/raphael/igpu.nix b/common/cpu/amd/raphael/igpu.nix index b094077..71b1152 100644 --- a/common/cpu/amd/raphael/igpu.nix +++ b/common/cpu/amd/raphael/igpu.nix @@ -1,9 +1,15 @@ -{ lib, pkgs, config, ... }: +{ + lib, + pkgs, + config, + ... +}: { # Sets the kernel version to the latest kernel to make the usage of the iGPU possible if your kernel version is too old # Disables scatter/gather which was introduced with kernel version 6.2 # It produces completely white or flashing screens when enabled while using the iGPU of Ryzen 7000-series CPUs (Raphael) + # This issue is not seen in kernel 6.6 or newer versions imports = [ ../. ]; @@ -12,8 +18,9 @@ kernelPackages = pkgs.linuxPackages_latest; }) - (lib.mkIf (lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.2") { - kernelParams = ["amdgpu.sg_display=0"]; - }) + (lib.mkIf ( + (lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.2") + && (lib.versionOlder config.boot.kernelPackages.kernel.version "6.6") + ) { kernelParams = [ "amdgpu.sg_display=0" ]; }) ]; } From cde8f7e11f036160b0fd6a9e07dc4c8e4061cf06 Mon Sep 17 00:00:00 2001 From: Ayoub NASR Date: Sun, 16 Jun 2024 15:42:26 +0200 Subject: [PATCH 40/88] Lenovo 16ACH6H: use zenpower kernel module --- lenovo/legion/16ach6h/hybrid/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/lenovo/legion/16ach6h/hybrid/default.nix b/lenovo/legion/16ach6h/hybrid/default.nix index 51e10dc..a33a02a 100644 --- a/lenovo/legion/16ach6h/hybrid/default.nix +++ b/lenovo/legion/16ach6h/hybrid/default.nix @@ -4,6 +4,7 @@ imports = [ ../../../../common/cpu/amd ../../../../common/cpu/amd/pstate.nix + ../../../../common/cpu/amd/zenpower.nix ../../../../common/gpu/amd ../../../../common/gpu/nvidia/prime.nix ../../../../common/pc/laptop From acb4f0e9bfa8ca2d6fca5e692307b5c994e7dbda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 19 Jun 2024 16:10:45 +0200 Subject: [PATCH 41/88] link to matrix room --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index a71f521..21b3228 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,10 @@ you can easily pin to a particular revision if you desire more stability. See [CONTRIBUTING.md](./CONTRIBUTING.md). +## Get in touch + +For questions and discussions, come join us in the [nixos-anywhere matrix](https://matrix.to/#/#nixos-hardware:nixos.org) room. + ## List of Profiles See code for all available configurations. From 56e370b3425253395f7119b731b2c536bc2cda5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 20 Jun 2024 12:08:04 +0200 Subject: [PATCH 42/88] deprecate commons/hdd module We havent't had anything meaningful configuration in this module for a while. So let's deprecate it. --- common/pc/hdd/default.nix | 10 +++++++++- common/pc/laptop/hdd/default.nix | 2 -- hp/elitebook/2560p/default.nix | 1 - hp/notebook/14-df0023/default.nix | 1 - 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/common/pc/hdd/default.nix b/common/pc/hdd/default.nix index 0967ef4..dbf7e66 100644 --- a/common/pc/hdd/default.nix +++ b/common/pc/hdd/default.nix @@ -1 +1,9 @@ -{} +{ + warnings = [ + '' + DEPRECATED: The module has been deprecated. + + This module has no effect and will be removed in a future release. + '' + ]; +} diff --git a/common/pc/laptop/hdd/default.nix b/common/pc/laptop/hdd/default.nix index 63f29d4..78f918d 100644 --- a/common/pc/laptop/hdd/default.nix +++ b/common/pc/laptop/hdd/default.nix @@ -1,8 +1,6 @@ { lib, ... }: { - imports = [ ../../hdd ]; - # Hard disk protection if the laptop falls: services.hdapsd.enable = lib.mkDefault true; } diff --git a/hp/elitebook/2560p/default.nix b/hp/elitebook/2560p/default.nix index 38e5d60..3802337 100644 --- a/hp/elitebook/2560p/default.nix +++ b/hp/elitebook/2560p/default.nix @@ -7,7 +7,6 @@ with lib; ../../../common/pc ../../../common/pc/laptop ../../../common/pc/laptop/hdd - ../../../common/pc/hdd ./network.nix ]; diff --git a/hp/notebook/14-df0023/default.nix b/hp/notebook/14-df0023/default.nix index 2edb7cd..ca6e30d 100644 --- a/hp/notebook/14-df0023/default.nix +++ b/hp/notebook/14-df0023/default.nix @@ -7,7 +7,6 @@ with lib; ../../../common/pc ../../../common/pc/laptop ../../../common/pc/laptop/hdd - ../../../common/pc/hdd ]; config = { From 28684889c8d4632309cf21ca3f41d570498f11b0 Mon Sep 17 00:00:00 2001 From: Matteo Bongiovanni Date: Sun, 16 Jun 2024 16:45:50 +0200 Subject: [PATCH 43/88] System76 Gaze18 nvidia System76 Gaze18 flake System76 Gaze18 fix System76 Gaze18 fix --- flake.nix | 1 + system76/gaze18/default.nix | 40 +++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 system76/gaze18/default.nix diff --git a/flake.nix b/flake.nix index b203958..a34fe9e 100644 --- a/flake.nix +++ b/flake.nix @@ -250,6 +250,7 @@ supermicro-x10sll-f = import ./supermicro/x10sll-f; supermicro-x12scz-tln4f = import ./supermicro/x12scz-tln4f; system76 = import ./system76; + system76-gaze18 = import ./system76/gaze18; system76-darp6 = import ./system76/darp6; toshiba-swanky = import ./toshiba/swanky; tuxedo-infinitybook-v4 = import ./tuxedo/infinitybook/v4; diff --git a/system76/gaze18/default.nix b/system76/gaze18/default.nix new file mode 100644 index 0000000..bdfe735 --- /dev/null +++ b/system76/gaze18/default.nix @@ -0,0 +1,40 @@ +{ config, lib, pkgs, ... }: +{ + imports = [ + ../. + ]; + boot.initrd.kernelModules = [ "nvidia" ]; + + hardware.opengl = { + enable = true; + driSupport = true; + driSupport32Bit = true; + extraPackages = with pkgs; [ + vaapiVdpau + ]; + }; + + services.xserver.videoDrivers = ["nvidia"]; + + hardware.nvidia = { + + modesetting.enable = true; + + powerManagement.finegrained = true; + + nvidiaSettings = true; + + package = config.boot.kernelPackages.nvidiaPackages.stable; + prime = { + intelBusId = "PCI:0:2:0"; + nvidiaBusId = "PCI:1:0:0"; + offload = { + enable = true; + enableOffloadCmd = true; + }; + }; + }; +} + + + From f5a5916b354e63e450d07bc06ea642752a1ea9d5 Mon Sep 17 00:00:00 2001 From: Matteo Bongiovanni Date: Sun, 16 Jun 2024 17:50:10 +0200 Subject: [PATCH 44/88] System76 mkDefault --- system76/gaze18/default.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/system76/gaze18/default.nix b/system76/gaze18/default.nix index bdfe735..5ce5123 100644 --- a/system76/gaze18/default.nix +++ b/system76/gaze18/default.nix @@ -6,9 +6,9 @@ boot.initrd.kernelModules = [ "nvidia" ]; hardware.opengl = { - enable = true; - driSupport = true; - driSupport32Bit = true; + enable = lib.mkDefault true; + driSupport = lib.mkDefault true; + driSupport32Bit = lib.mkDefault true; extraPackages = with pkgs; [ vaapiVdpau ]; @@ -18,11 +18,11 @@ hardware.nvidia = { - modesetting.enable = true; + modesetting.enable = lib.mkDefault true; - powerManagement.finegrained = true; + powerManagement.finegrained = lib.mkDefault true; - nvidiaSettings = true; + nvidiaSettings = lib.mkDefault true; package = config.boot.kernelPackages.nvidiaPackages.stable; prime = { @@ -30,7 +30,7 @@ nvidiaBusId = "PCI:1:0:0"; offload = { enable = true; - enableOffloadCmd = true; + enableOffloadCmd = lib.mkDefault true; }; }; }; From b34b29254745a89d20e15c37a3a836ca11a9526e Mon Sep 17 00:00:00 2001 From: Matteo Bongiovanni Date: Mon, 17 Jun 2024 15:55:12 +0200 Subject: [PATCH 45/88] System76 Gaze18 cleanup --- system76/gaze18/default.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/system76/gaze18/default.nix b/system76/gaze18/default.nix index 5ce5123..d3b0044 100644 --- a/system76/gaze18/default.nix +++ b/system76/gaze18/default.nix @@ -35,6 +35,3 @@ }; }; } - - - From 49705fd8397d80c08f59ce67f37e9d32b376d3e3 Mon Sep 17 00:00:00 2001 From: Matteo Bongiovanni Date: Tue, 18 Jun 2024 09:08:59 +0200 Subject: [PATCH 46/88] add system76 Gaze18 to README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 21b3228..8b794dc 100644 --- a/README.md +++ b/README.md @@ -312,6 +312,7 @@ See code for all available configurations. | [Supermicro X12SCZ-TLN4F](supermicro/x12scz-tln4f) | `` | | [System76 (generic)](system76) | `` | | [System76 Darter Pro 6](system76/darp6) | `` | +| [System76 Gazelle Gaze18](system76/gaze18) | `` | | [Toshiba Chromebook 2 `swanky`](toshiba/swanky) | `` | | [Tuxedo InfinityBook v4](tuxedo/infinitybook/v4) | `` | | [TUXEDO InfinityBook Pro 14 - Gen7](tuxedo/infinitybook/pro14/gen7) | `` | From d23f980d75df52ab675cddd1fe3e8038eda79016 Mon Sep 17 00:00:00 2001 From: Matteo Bongiovanni Date: Tue, 18 Jun 2024 09:20:22 +0200 Subject: [PATCH 47/88] System76 Gaze18 cleanup --- system76/gaze18/default.nix | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/system76/gaze18/default.nix b/system76/gaze18/default.nix index d3b0044..813d218 100644 --- a/system76/gaze18/default.nix +++ b/system76/gaze18/default.nix @@ -2,36 +2,23 @@ { imports = [ ../. + ../../common/gpu/nvidia/prime.nix ]; - boot.initrd.kernelModules = [ "nvidia" ]; - hardware.opengl = { enable = lib.mkDefault true; driSupport = lib.mkDefault true; driSupport32Bit = lib.mkDefault true; - extraPackages = with pkgs; [ - vaapiVdpau - ]; }; - services.xserver.videoDrivers = ["nvidia"]; - hardware.nvidia = { modesetting.enable = lib.mkDefault true; powerManagement.finegrained = lib.mkDefault true; - nvidiaSettings = lib.mkDefault true; - - package = config.boot.kernelPackages.nvidiaPackages.stable; prime = { intelBusId = "PCI:0:2:0"; nvidiaBusId = "PCI:1:0:0"; - offload = { - enable = true; - enableOffloadCmd = lib.mkDefault true; - }; }; }; } From 972f0149f26f44bd884e3140070f4e973ca043bd Mon Sep 17 00:00:00 2001 From: Matteo Bongiovanni Date: Tue, 18 Jun 2024 16:53:21 +0200 Subject: [PATCH 48/88] System76 Gaze18 nvidia not loaded fix and remove modesetting System76 Gaze18 remove modesetting --- system76/gaze18/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/system76/gaze18/default.nix b/system76/gaze18/default.nix index 813d218..94e6b9e 100644 --- a/system76/gaze18/default.nix +++ b/system76/gaze18/default.nix @@ -4,6 +4,9 @@ ../. ../../common/gpu/nvidia/prime.nix ]; + + boot.initrd.kernelModules = [ "nvidia" ]; + hardware.opengl = { enable = lib.mkDefault true; driSupport = lib.mkDefault true; @@ -12,7 +15,7 @@ hardware.nvidia = { - modesetting.enable = lib.mkDefault true; + # modesetting.enable = lib.mkDefault true; powerManagement.finegrained = lib.mkDefault true; From 4d6b7dfa61ccf39b90bb980d702de3130c940c50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 20 Jun 2024 06:58:42 +0200 Subject: [PATCH 49/88] system76/gaze18: drop redundant driSupport --- system76/gaze18/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/system76/gaze18/default.nix b/system76/gaze18/default.nix index 94e6b9e..3ad85a0 100644 --- a/system76/gaze18/default.nix +++ b/system76/gaze18/default.nix @@ -9,7 +9,6 @@ hardware.opengl = { enable = lib.mkDefault true; - driSupport = lib.mkDefault true; driSupport32Bit = lib.mkDefault true; }; From 0307a32b553f81056edd6455168c635aeda6743b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 20 Jun 2024 07:02:31 +0200 Subject: [PATCH 50/88] system76/gaze18: add comment about implication of adding driSupport32Bit --- system76/gaze18/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/system76/gaze18/default.nix b/system76/gaze18/default.nix index 3ad85a0..7b87f1a 100644 --- a/system76/gaze18/default.nix +++ b/system76/gaze18/default.nix @@ -9,6 +9,7 @@ hardware.opengl = { enable = lib.mkDefault true; + # adds ~100MB of 32-bit mesa drivers. driSupport32Bit = lib.mkDefault true; }; From 144f53f534c553dadbf80388e930d0bb494f7b58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 20 Jun 2024 15:51:13 +0200 Subject: [PATCH 51/88] common: remove deprecated modules --- common/gpu/intel.nix | 11 ----------- common/gpu/nvidia-disable.nix | 11 ----------- common/gpu/nvidia.nix | 12 ------------ 3 files changed, 34 deletions(-) delete mode 100644 common/gpu/intel.nix delete mode 100644 common/gpu/nvidia-disable.nix delete mode 100644 common/gpu/nvidia.nix diff --git a/common/gpu/intel.nix b/common/gpu/intel.nix deleted file mode 100644 index d4256f6..0000000 --- a/common/gpu/intel.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ - imports = [ ./intel ]; - - warnings = [ - '' - DEPRECATED: The module has been deprecated. - - Switch to using instead. - '' - ]; -} diff --git a/common/gpu/nvidia-disable.nix b/common/gpu/nvidia-disable.nix deleted file mode 100644 index 3f28c4e..0000000 --- a/common/gpu/nvidia-disable.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ - imports = [ ./nvidia/disable.nix ]; - - warnings = [ - '' - DEPRECATED: The module has been deprecated. - - Switch to using instead. - '' - ]; -} diff --git a/common/gpu/nvidia.nix b/common/gpu/nvidia.nix deleted file mode 100644 index 9443b06..0000000 --- a/common/gpu/nvidia.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ - imports = [ ./nvidia/prime.nix ]; - - warnings = [ - '' - DEPRECATED: The module has been deprecated. - - Switch to using instead if you use prime offloading. - If you are using this without prime, consider switching to instead. - '' - ]; -} From 083823b7904e43a4fc1c7229781417e875359a42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 20 Jun 2024 16:05:41 +0200 Subject: [PATCH 52/88] gpu/amd: drop hardware.amdgpu.opencl option This now conflicts with nixpkgs. --- common/gpu/amd/default.nix | 11 ----------- lenovo/legion/15ach6h/nvidia/default.nix | 6 ++++-- lenovo/legion/16ach6h/nvidia/default.nix | 6 ++++-- lenovo/legion/16achg6/nvidia/default.nix | 6 ++++-- 4 files changed, 12 insertions(+), 17 deletions(-) diff --git a/common/gpu/amd/default.nix b/common/gpu/amd/default.nix index 26cd833..6987d6e 100644 --- a/common/gpu/amd/default.nix +++ b/common/gpu/amd/default.nix @@ -6,11 +6,6 @@ ) // { default = true; }; - options.hardware.amdgpu.opencl = lib.mkEnableOption (lib.mdDoc - "rocm opencl runtime (Install rocmPackages.clr and rocmPackages.clr.icd)" - ) // { - default = true; - }; config = lib.mkMerge [ { @@ -24,11 +19,5 @@ (lib.mkIf config.hardware.amdgpu.loadInInitrd { boot.initrd.kernelModules = [ "amdgpu" ]; }) - (lib.mkIf config.hardware.amdgpu.opencl { - hardware.opengl.extraPackages = - if pkgs ? rocmPackages.clr - then with pkgs.rocmPackages; [ clr clr.icd ] - else with pkgs; [ rocm-opencl-icd rocm-opencl-runtime ]; - }) ]; } diff --git a/lenovo/legion/15ach6h/nvidia/default.nix b/lenovo/legion/15ach6h/nvidia/default.nix index ad62415..33f3265 100644 --- a/lenovo/legion/15ach6h/nvidia/default.nix +++ b/lenovo/legion/15ach6h/nvidia/default.nix @@ -1,4 +1,4 @@ -{ ... }: +{ lib, options, ... }: { imports = [ ../hybrid ]; @@ -12,6 +12,8 @@ # of nix cannot implement such an operation as canceling an import. hardware = { nvidia.prime.offload.enable = false; - amdgpu.opencl = false; + } // lib.optionalAttrs (options ? amdgpu.opencl.enable) { + # introduced in https://github.com/NixOS/nixpkgs/pull/319865 + amdgpu.opencl.enable = lib.mkDefault false; }; } diff --git a/lenovo/legion/16ach6h/nvidia/default.nix b/lenovo/legion/16ach6h/nvidia/default.nix index ad62415..33f3265 100644 --- a/lenovo/legion/16ach6h/nvidia/default.nix +++ b/lenovo/legion/16ach6h/nvidia/default.nix @@ -1,4 +1,4 @@ -{ ... }: +{ lib, options, ... }: { imports = [ ../hybrid ]; @@ -12,6 +12,8 @@ # of nix cannot implement such an operation as canceling an import. hardware = { nvidia.prime.offload.enable = false; - amdgpu.opencl = false; + } // lib.optionalAttrs (options ? amdgpu.opencl.enable) { + # introduced in https://github.com/NixOS/nixpkgs/pull/319865 + amdgpu.opencl.enable = lib.mkDefault false; }; } diff --git a/lenovo/legion/16achg6/nvidia/default.nix b/lenovo/legion/16achg6/nvidia/default.nix index aa292cd..5c933fa 100644 --- a/lenovo/legion/16achg6/nvidia/default.nix +++ b/lenovo/legion/16achg6/nvidia/default.nix @@ -1,10 +1,12 @@ -{ ... }: +{ lib, options, ... }: { imports = [ ../hybrid ]; services.xserver.videoDrivers = [ "nvidia" ]; hardware = { nvidia.prime.offload.enable = false; - amdgpu.opencl = false; + } // lib.optionalAttrs (options ? amdgpu.opencl.enable) { + # introduced in https://github.com/NixOS/nixpkgs/pull/319865 + amdgpu.opencl.enable = lib.mkDefault false; }; } From 68ef79e804710488c4ba158ad14a529b12a65279 Mon Sep 17 00:00:00 2001 From: Zach Coyle Date: Thu, 20 Jun 2024 17:15:06 -0400 Subject: [PATCH 53/88] apple/t2: update to kernel 6.9.4 --- apple/t2/pkgs/linux-t2.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apple/t2/pkgs/linux-t2.nix b/apple/t2/pkgs/linux-t2.nix index beff7a3..ea8fbdc 100644 --- a/apple/t2/pkgs/linux-t2.nix +++ b/apple/t2/pkgs/linux-t2.nix @@ -5,11 +5,11 @@ let patchRepo = fetchFromGitHub { owner = "t2linux"; repo = "linux-t2-patches"; - rev = "33d5a01c41f140a416a7f840cc06e7f30dc58d8d"; - hash = "sha256-wx5jkOQ8l/4XRGLV9KFrxXuqunwcFA9RB1yhrtseP2A="; + rev = "0ad2b3913f5484ba8e86b6965f5d88903464261d"; + hash = "sha256-mwT4cuIBrz3tz8+fAxVKmnRtkPRp3lWmNbocuXCsm44="; }; - version = "6.9.3"; + version = "6.9.4"; majorVersion = with lib; (elemAt (take 1 (splitVersion version)) 0); in buildLinux (args // { @@ -22,7 +22,7 @@ buildLinux (args // { src = runCommand "patched-source" {} '' cp -r ${fetchzip { url = "mirror://kernel/linux/kernel/v${majorVersion}.x/linux-${version}.tar.xz"; - hash = "sha256-7262WHO2veIn+9cd4m9io1ov93LsfpgRKfmvBx0DCBA="; + hash = "sha256-8jC5DpPi6poig1gmJPIIZ2HMwQQt1kTK4PcvyYm+Hsg="; }} $out chmod -R u+w $out cd $out From 27487bcd12139b8b20442252e1fc3895d4394ce1 Mon Sep 17 00:00:00 2001 From: Flameopathic <64027365+Flameopathic@users.noreply.github.com> Date: Thu, 20 Jun 2024 20:45:41 -0400 Subject: [PATCH 54/88] change iptsd and system-control to nixpkgs versions - fixes iptsd bug --- microsoft/surface/common/default.nix | 2 - microsoft/surface/common/ipts/default.nix | 48 ------------------- .../common/surface-control/default.nix | 25 ---------- .../surface/surface-laptop-amd/default.nix | 6 +-- .../surface/surface-pro-intel/default.nix | 6 +-- 5 files changed, 6 insertions(+), 81 deletions(-) delete mode 100644 microsoft/surface/common/ipts/default.nix delete mode 100644 microsoft/surface/common/surface-control/default.nix diff --git a/microsoft/surface/common/default.nix b/microsoft/surface/common/default.nix index 7499a19..057142c 100644 --- a/microsoft/surface/common/default.nix +++ b/microsoft/surface/common/default.nix @@ -6,8 +6,6 @@ let in { imports = [ ./kernel - ./ipts - ./surface-control ]; microsoft-surface.kernelVersion = mkDefault "6.6"; diff --git a/microsoft/surface/common/ipts/default.nix b/microsoft/surface/common/ipts/default.nix deleted file mode 100644 index 8e1f475..0000000 --- a/microsoft/surface/common/ipts/default.nix +++ /dev/null @@ -1,48 +0,0 @@ -{ config, lib, pkgs, ... }: - -let - inherit (lib) mkDefault mkEnableOption mkIf mkMerge mkOption types; - - cfg = config.microsoft-surface.ipts; - - iptsConfFile = pkgs.writeTextFile { - name = "iptsd.conf"; - text = lib.generators.toINI { } cfg.config; - }; - -in -{ - options.microsoft-surface.ipts = { - enable = mkEnableOption "Enable IPTSd for Microsoft Surface"; - - config = mkOption { - type = types.attrs; - default = { }; - description = '' - Values to wrote to iptsd.conf, first key is section, second key is property. - See the example config; https://github.com/linux-surface/iptsd/blob/v1.4.0/etc/iptsd.conf - ''; - example = '' - DFT = { - ButtonMinMag = 1000; - }; - ''; - }; - }; - - config = mkMerge [ - { - microsoft-surface.ipts.enable = mkDefault false; - } - - (mkIf cfg.enable { - systemd.services.iptsd = { - description = "IPTSD"; - path = with pkgs; [ iptsd ]; - script = "iptsd $(iptsd-find-hidraw)"; - wantedBy = [ "multi-user.target" ]; - }; - environment.etc."iptsd/iptsd.conf".source = "${iptsConfFile}"; - }) - ]; -} diff --git a/microsoft/surface/common/surface-control/default.nix b/microsoft/surface/common/surface-control/default.nix deleted file mode 100644 index 4927c24..0000000 --- a/microsoft/surface/common/surface-control/default.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ config, lib, pkgs, ... }: - - -let - inherit (lib) mkDefault mkEnableOption mkIf mkMerge; - - cfg = config.microsoft-surface.surface-control; - -in { - options.microsoft-surface.surface-control = { - enable = mkEnableOption "Enable 'surface-control' for Microsoft Surface"; - }; - - config = mkMerge [ - { - microsoft-surface.surface-control.enable = mkDefault false; - } - - (mkIf cfg.enable { - environment.systemPackages = with pkgs; [ surface-control ]; - services.udev.packages = with pkgs; [ surface-control]; - users.groups.surface-control = { }; - }) - ]; -} diff --git a/microsoft/surface/surface-laptop-amd/default.nix b/microsoft/surface/surface-laptop-amd/default.nix index 4985911..644b7d9 100644 --- a/microsoft/surface/surface-laptop-amd/default.nix +++ b/microsoft/surface/surface-laptop-amd/default.nix @@ -1,4 +1,4 @@ -{ ... }: +{ lib, pkgs, ... }: # This module is intended to support the Surface Laptop range, specifically those with AMD CPUs. # It's expected it will work equally well on many other Surface models, but they may need further @@ -15,6 +15,6 @@ ]; # Note: The IPTS module is not often required on devices with Surface Laptop 3 (AMD). - microsoft-surface.ipts.enable = true; - microsoft-surface.surface-control.enable = true; + services.iptsd.enable = lib.mkDefault true; + environment.systemPackages = [ pkgs.surface-control ]; } diff --git a/microsoft/surface/surface-pro-intel/default.nix b/microsoft/surface/surface-pro-intel/default.nix index 026843a..a1ab89c 100644 --- a/microsoft/surface/surface-pro-intel/default.nix +++ b/microsoft/surface/surface-pro-intel/default.nix @@ -1,4 +1,4 @@ -{ ... }: +{ lib, pkgs, ... }: # This module is intended to support the Surface Pro range, specifically those with Intel CPUs. # It's expected it will work equally well on many other Surface models, but they may need further @@ -13,6 +13,6 @@ ../../../common/cpu/intel ]; - microsoft-surface.ipts.enable = true; - microsoft-surface.surface-control.enable = true; + services.iptsd.enable = lib.mkDefault true; + environment.systemPackages = [ pkgs.surface-control ]; } From cc634b69c8312c4e88469d3c7e8fb5ecc72e7dc6 Mon Sep 17 00:00:00 2001 From: toastal Date: Fri, 21 Jun 2024 20:44:42 +0700 Subject: [PATCH 55/88] =?UTF-8?q?remove=20driSupport,=20opengl=20=E2=86=92?= =?UTF-8?q?=20graphics?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- acer/aspire/4810t/default.nix | 3 --- apple/macbook-pro/10-1/default.nix | 4 +++- apple/macmini/4/default.nix | 23 ++++++++++---------- asus/zephyrus/ga402x/amdgpu/default.nix | 2 +- asus/zephyrus/ga402x/nvidia/default.nix | 2 +- common/gpu/amd/default.nix | 6 ++--- common/gpu/intel/default.nix | 6 ++--- common/gpu/nvidia/default.nix | 2 +- dell/precision/7520/default.nix | 29 +++++++++++++------------ dell/xps/15-9510/nvidia/default.nix | 10 ++++----- focus/m2/gen1/default.nix | 5 ++--- gpd/pocket-3/default.nix | 2 +- lenovo/thinkpad/p1/3th-gen/nvidia.nix | 23 ++++++++++++-------- lenovo/thinkpad/p50/default.nix | 6 ----- lenovo/thinkpad/p51/default.nix | 11 +++++----- lenovo/thinkpad/p52/default.nix | 12 +++++----- lenovo/yoga/6/13ALC6/default.nix | 2 +- lenovo/yoga/7/14ARH7/amdgpu/default.nix | 2 +- lenovo/yoga/7/14ARH7/nvidia/default.nix | 2 +- system76/gaze18/default.nix | 5 ++--- 20 files changed, 77 insertions(+), 80 deletions(-) diff --git a/acer/aspire/4810t/default.nix b/acer/aspire/4810t/default.nix index d40b454..c0f95dc 100644 --- a/acer/aspire/4810t/default.nix +++ b/acer/aspire/4810t/default.nix @@ -19,9 +19,6 @@ ]; }; - # TODO: reverse compat - hardware.opengl.driSupport = false; - # TODO: reverse compat services.xserver = { defaultDepth = lib.mkDefault 24; diff --git a/apple/macbook-pro/10-1/default.nix b/apple/macbook-pro/10-1/default.nix index 3703096..f3f58c2 100644 --- a/apple/macbook-pro/10-1/default.nix +++ b/apple/macbook-pro/10-1/default.nix @@ -1,3 +1,5 @@ +{ lib, ... }: + { imports = [ ../. @@ -5,7 +7,7 @@ ]; # TODO: reverse compat - hardware.opengl.driSupport32Bit = true; + hardware.graphics.enable32Bit = lib.mkDefault true; services.xserver = { # TODO: we should not enable unfree drivers diff --git a/apple/macmini/4/default.nix b/apple/macmini/4/default.nix index fd3062d..86210c4 100644 --- a/apple/macmini/4/default.nix +++ b/apple/macmini/4/default.nix @@ -12,17 +12,18 @@ in services.xserver.videoDrivers = mkDefault [ "nvidiaLegacy340" ]; - hardware.opengl = { - enable = mkDefault true; - driSupport = mkDefault true; - driSupport32Bit = mkDefault true; - }; + hardware = { + graphics = { + enable = mkDefault true; + enable32Bit = mkDefault true; + }; - hardware.nvidia = { - modesetting.enable = mkDefault true; - powerManagement.enable = mkDefault false; - powerManagement.finegrained = mkDefault false; - open = mkDefault false; - nvidiaSettings = mkDefault true; + nvidia = { + modesetting.enable = mkDefault true; + powerManagement.enable = mkDefault false; + powerManagement.finegrained = mkDefault false; + open = mkDefault false; + nvidiaSettings = mkDefault true; + }; }; } diff --git a/asus/zephyrus/ga402x/amdgpu/default.nix b/asus/zephyrus/ga402x/amdgpu/default.nix index 17103c5..80a508f 100644 --- a/asus/zephyrus/ga402x/amdgpu/default.nix +++ b/asus/zephyrus/ga402x/amdgpu/default.nix @@ -26,7 +26,7 @@ in { hardware = { amdgpu.loadInInitrd = true; - opengl.extraPackages = with pkgs; [ + graphics.extraPackages = with pkgs; [ vaapiVdpau libvdpau-va-gl ]; diff --git a/asus/zephyrus/ga402x/nvidia/default.nix b/asus/zephyrus/ga402x/nvidia/default.nix index 7a1a8c3..73a2b9d 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; - opengl.extraPackages = with pkgs; [ + graphics.extraPackages = with pkgs; [ # Also in nvidia/default.nix vaapiVdpau libvdpau-va-gl diff --git a/common/gpu/amd/default.nix b/common/gpu/amd/default.nix index 6987d6e..9228bc3 100644 --- a/common/gpu/amd/default.nix +++ b/common/gpu/amd/default.nix @@ -11,9 +11,9 @@ { services.xserver.videoDrivers = lib.mkDefault [ "modesetting" ]; - hardware.opengl = { - driSupport = lib.mkDefault true; - driSupport32Bit = lib.mkDefault true; + hardware.graphics = { + enable = lib.mkDefault true; + enable32Bit = lib.mkDefault true; }; } (lib.mkIf config.hardware.amdgpu.loadInInitrd { diff --git a/common/gpu/intel/default.nix b/common/gpu/intel/default.nix index 91c8765..90afad1 100644 --- a/common/gpu/intel/default.nix +++ b/common/gpu/intel/default.nix @@ -26,10 +26,10 @@ boot.initrd.kernelModules = [ config.hardware.intelgpu.driver ]; environment.variables = { - VDPAU_DRIVER = lib.mkIf config.hardware.opengl.enable (lib.mkDefault "va_gl"); + VDPAU_DRIVER = lib.mkIf config.hardware.graphics.enable (lib.mkDefault "va_gl"); }; - hardware.opengl.extraPackages = with pkgs; [ + hardware.graphics.extraPackages = with pkgs; [ ( if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then vaapiIntel @@ -40,7 +40,7 @@ intel-media-driver ]; - hardware.opengl.extraPackages32 = with pkgs.driversi686Linux; [ + hardware.graphics.extraPackages32 = with pkgs.driversi686Linux; [ ( if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then vaapiIntel diff --git a/common/gpu/nvidia/default.nix b/common/gpu/nvidia/default.nix index 47f2d34..43b4608 100644 --- a/common/gpu/nvidia/default.nix +++ b/common/gpu/nvidia/default.nix @@ -2,7 +2,7 @@ { services.xserver.videoDrivers = lib.mkDefault [ "nvidia" ]; - hardware.opengl.extraPackages = with pkgs; [ + hardware.graphics.extraPackages = with pkgs; [ vaapiVdpau ]; } diff --git a/dell/precision/7520/default.nix b/dell/precision/7520/default.nix index c20ea89..db5626f 100644 --- a/dell/precision/7520/default.nix +++ b/dell/precision/7520/default.nix @@ -21,25 +21,26 @@ }; boot.kernelParams = ["i915.modeset=1"]; - hardware.nvidia = { - package = config.boot.kernelPackages.nvidiaPackages.legacy_390; - nvidiaSettings = lib.mkDefault true; - modesetting.enable = lib.mkDefault true; - open = lib.mkDefault false; - prime = { - intelBusId = "PCI:0:2:0"; - nvidiaBusId = "PCI:1:0:0"; + hardware = { + graphics = { + enable = lib.mkDefault true; + enable32Bit = lib.mkDefault true; + }; + nvidia = { + package = config.boot.kernelPackages.nvidiaPackages.legacy_390; + nvidiaSettings = lib.mkDefault true; + modesetting.enable = lib.mkDefault true; + open = lib.mkDefault false; + prime = { + intelBusId = "PCI:0:2:0"; + nvidiaBusId = "PCI:1:0:0"; + }; }; - }; - hardware.opengl = { - enable = lib.mkDefault true; - driSupport = lib.mkDefault true; - driSupport32Bit = lib.mkDefault true; }; # Override the intel gpu driver setting imported above environment.variables = { - VDPAU_DRIVER = lib.mkIf config.hardware.opengl.enable (lib.mkOverride 990 "nvidia"); + VDPAU_DRIVER = lib.mkIf config.hardware.graphics.enable (lib.mkOverride 990 "nvidia"); }; services.thermald.enable = lib.mkDefault true; diff --git a/dell/xps/15-9510/nvidia/default.nix b/dell/xps/15-9510/nvidia/default.nix index 723c574..990aea7 100644 --- a/dell/xps/15-9510/nvidia/default.nix +++ b/dell/xps/15-9510/nvidia/default.nix @@ -5,6 +5,11 @@ services.switcherooControl.enable = lib.mkDefault true; hardware = { + graphics = { + enable = lib.mkDefault true; + enable32Bit = lib.mkDefault true; + extraPackages = with pkgs; [ intel-media-driver intel-compute-runtime ]; + }; nvidia = { prime = { # Bus ID of the Intel GPU. @@ -20,10 +25,5 @@ finegrained = lib.mkDefault true; }; }; - opengl = { - enable = lib.mkDefault true; - driSupport32Bit = lib.mkDefault true; - extraPackages = with pkgs; [ intel-media-driver intel-compute-runtime ]; - }; }; } diff --git a/focus/m2/gen1/default.nix b/focus/m2/gen1/default.nix index 74e4df3..27ee1f3 100644 --- a/focus/m2/gen1/default.nix +++ b/focus/m2/gen1/default.nix @@ -18,10 +18,9 @@ boot.blacklistedKernelModules = [ "i2c_nvidia_gpu" ]; hardware.nvidia.modesetting.enable = lib.mkDefault true; - hardware.opengl = { + hardware.graphics = { enable = lib.mkDefault true; - driSupport = lib.mkDefault true; - driSupport32Bit = lib.mkDefault true; + enable32Bit = lib.mkDefault true; }; hardware.nvidia.prime = { diff --git a/gpd/pocket-3/default.nix b/gpd/pocket-3/default.nix index 52d0913..73d2bed 100644 --- a/gpd/pocket-3/default.nix +++ b/gpd/pocket-3/default.nix @@ -14,7 +14,7 @@ in # GPU is an Intel Iris Xe, on a “TigerLake” mobile CPU boot.initrd.kernelModules = [ "i915" ]; # Early loading so the passphrase prompt appears on external displays services.xserver.videoDrivers = [ "intel" ]; - hardware.opengl.extraPackages = with pkgs; [ + hardware.graphics.extraPackages = with pkgs; [ intel-media-driver (if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then vaapiIntel else intel-vaapi-driver) ]; diff --git a/lenovo/thinkpad/p1/3th-gen/nvidia.nix b/lenovo/thinkpad/p1/3th-gen/nvidia.nix index 0808107..6f939e9 100644 --- a/lenovo/thinkpad/p1/3th-gen/nvidia.nix +++ b/lenovo/thinkpad/p1/3th-gen/nvidia.nix @@ -1,13 +1,18 @@ { lib, ... }: { - hardware.nvidia.modesetting.enable = true; - hardware.opengl.driSupport32Bit = true; - hardware.opengl.enable = true; - - hardware.nvidia.prime = { - # Bus ID of the Intel GPU. - intelBusId = lib.mkDefault "PCI:0:2:0"; - # Bus ID of the NVIDIA GPU. - nvidiaBusId = lib.mkDefault "PCI:1:0:0"; + hardware = { + graphics = { + enable = lib.mkDefault true; + enable32Bit = lib.mkDefault true; + }; + nvidia = { + modesetting.enable = lib.mkDefault true; + prime = { + # Bus ID of the Intel GPU. + intelBusId = lib.mkDefault "PCI:0:2:0"; + # Bus ID of the NVIDIA GPU. + nvidiaBusId = lib.mkDefault "PCI:1:0:0"; + }; + }; }; } diff --git a/lenovo/thinkpad/p50/default.nix b/lenovo/thinkpad/p50/default.nix index 3e77eb5..ef2cbd5 100644 --- a/lenovo/thinkpad/p50/default.nix +++ b/lenovo/thinkpad/p50/default.nix @@ -13,12 +13,6 @@ nvidiaBusId = lib.mkDefault "PCI:1:0:0"; }; }; - - # is this too much? It's convenient for Steam. - opengl = { - driSupport = lib.mkDefault true; - driSupport32Bit = lib.mkDefault true; - }; }; # required to make wireless work diff --git a/lenovo/thinkpad/p51/default.nix b/lenovo/thinkpad/p51/default.nix index 4c9be3c..ca86455 100644 --- a/lenovo/thinkpad/p51/default.nix +++ b/lenovo/thinkpad/p51/default.nix @@ -8,18 +8,17 @@ ]; hardware = { + graphics = { + enable = lib.mkDefault true; + enable32Bit = lib.mkDefault true; + }; + nvidia = { prime = { intelBusId = lib.mkDefault "PCI:0:2:0"; nvidiaBusId = lib.mkDefault "PCI:1:0:0"; }; }; - - # is this too much? It's convenient for Steam. - opengl = { - driSupport = lib.mkDefault true; - driSupport32Bit = lib.mkDefault true; - }; }; # required to make wireless work diff --git a/lenovo/thinkpad/p52/default.nix b/lenovo/thinkpad/p52/default.nix index 31c9294..e768923 100644 --- a/lenovo/thinkpad/p52/default.nix +++ b/lenovo/thinkpad/p52/default.nix @@ -7,18 +7,18 @@ ]; hardware = { + # is this too much? It's convenient for Steam. + graphics = { + enable = lib.mkDefault true; + enable32Bit = lib.mkDefault true; + }; + nvidia = { prime = { intelBusId = lib.mkDefault "PCI:0:2:0"; nvidiaBusId = lib.mkDefault "PCI:1:0:0"; }; }; - - # is this too much? It's convenient for Steam. - opengl = { - driSupport = lib.mkDefault true; - driSupport32Bit = lib.mkDefault true; - }; }; # required to make wireless work diff --git a/lenovo/yoga/6/13ALC6/default.nix b/lenovo/yoga/6/13ALC6/default.nix index bd2e80c..1177bc7 100644 --- a/lenovo/yoga/6/13ALC6/default.nix +++ b/lenovo/yoga/6/13ALC6/default.nix @@ -7,7 +7,7 @@ ]; boot.initrd.kernelModules = [ "ideapad_laptop" ]; - hardware.opengl.extraPackages = with pkgs; [ + hardware.graphics.extraPackages = with pkgs; [ vaapiVdpau libvdpau-va-gl ]; diff --git a/lenovo/yoga/7/14ARH7/amdgpu/default.nix b/lenovo/yoga/7/14ARH7/amdgpu/default.nix index 4d16de0..6630911 100644 --- a/lenovo/yoga/7/14ARH7/amdgpu/default.nix +++ b/lenovo/yoga/7/14ARH7/amdgpu/default.nix @@ -15,7 +15,7 @@ in { hardware = { amdgpu.loadInInitrd = true; - opengl.extraPackages = with pkgs; [ + graphics.extraPackages = with pkgs; [ vaapiVdpau libvdpau-va-gl ]; diff --git a/lenovo/yoga/7/14ARH7/nvidia/default.nix b/lenovo/yoga/7/14ARH7/nvidia/default.nix index fb4553e..6c97a07 100644 --- a/lenovo/yoga/7/14ARH7/nvidia/default.nix +++ b/lenovo/yoga/7/14ARH7/nvidia/default.nix @@ -19,7 +19,7 @@ in { hardware = { ## Enable the Nvidia card, as well as Prime and Offload: amdgpu.loadInInitrd = true; - opengl.extraPackages = with pkgs; [ + graphics.extraPackages = with pkgs; [ vaapiVdpau libvdpau-va-gl ]; diff --git a/system76/gaze18/default.nix b/system76/gaze18/default.nix index 7b87f1a..0485e16 100644 --- a/system76/gaze18/default.nix +++ b/system76/gaze18/default.nix @@ -7,10 +7,9 @@ boot.initrd.kernelModules = [ "nvidia" ]; - hardware.opengl = { + hardware.graphics = { enable = lib.mkDefault true; - # adds ~100MB of 32-bit mesa drivers. - driSupport32Bit = lib.mkDefault true; + enable32Bit = lib.mkDefault true; }; hardware.nvidia = { From 584a5e551885382c1cf9b09a990fbcd2ccbc992f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 21 Jun 2024 23:26:44 +0200 Subject: [PATCH 56/88] fix 24.05 evaluation --- .github/workflows/test.yml | 5 +++- apple/macbook-pro/10-1/default.nix | 1 + apple/macmini/4/default.nix | 1 + asus/zephyrus/ga402x/amdgpu/default.nix | 1 + common/gpu/24.05-compat.nix | 37 +++++++++++++++++++++++++ common/gpu/amd/default.nix | 1 + common/gpu/intel/default.nix | 1 + common/gpu/nvidia/default.nix | 1 + dell/precision/7520/default.nix | 2 -- gpd/pocket-3/default.nix | 1 + lenovo/thinkpad/p1/3th-gen/nvidia.nix | 3 ++ lenovo/thinkpad/p51/default.nix | 1 + lenovo/thinkpad/p52/default.nix | 1 + lenovo/yoga/6/13ALC6/default.nix | 1 + lenovo/yoga/7/14ARH7/amdgpu/default.nix | 1 + tests/run.py | 2 +- 16 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 common/gpu/24.05-compat.nix diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 54a9c48..7c67a21 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,11 +7,14 @@ on: jobs: tests: runs-on: ubuntu-latest + strategy: + matrix: + channel: [ nixos-unstable, nixos-24.05 ] steps: - uses: actions/checkout@v4 - uses: cachix/install-nix-action@V27 with: - nix_path: nixpkgs=channel:nixos-unstable + nix_path: nixpkgs=channel:${{ matrix.channel }} - name: Show nixpkgs version run: nix-instantiate --eval -E '(import {}).lib.version' - run: ./tests/run.py diff --git a/apple/macbook-pro/10-1/default.nix b/apple/macbook-pro/10-1/default.nix index f3f58c2..2a2c624 100644 --- a/apple/macbook-pro/10-1/default.nix +++ b/apple/macbook-pro/10-1/default.nix @@ -4,6 +4,7 @@ imports = [ ../. ../../../common/pc/laptop/ssd + ../../../common/gpu/24.05-compat.nix ]; # TODO: reverse compat diff --git a/apple/macmini/4/default.nix b/apple/macmini/4/default.nix index 86210c4..fd6d9c9 100644 --- a/apple/macmini/4/default.nix +++ b/apple/macmini/4/default.nix @@ -8,6 +8,7 @@ in { imports = [ ../. + ../../../common/gpu/24.05-compat.nix ]; services.xserver.videoDrivers = mkDefault [ "nvidiaLegacy340" ]; diff --git a/asus/zephyrus/ga402x/amdgpu/default.nix b/asus/zephyrus/ga402x/amdgpu/default.nix index 80a508f..b1791d7 100644 --- a/asus/zephyrus/ga402x/amdgpu/default.nix +++ b/asus/zephyrus/ga402x/amdgpu/default.nix @@ -11,6 +11,7 @@ let in { imports = [ ../shared.nix + ../../../../common/gpu/24.05-compat.nix ]; options.hardware.asus.zephyrus.ga402x.amdgpu = { diff --git a/common/gpu/24.05-compat.nix b/common/gpu/24.05-compat.nix new file mode 100644 index 0000000..ca53247 --- /dev/null +++ b/common/gpu/24.05-compat.nix @@ -0,0 +1,37 @@ +{ + config, + lib, + ... +}: +{ + # Backward-compat for 24.05, can be removed after we drop 24.05 support + options = { + hardware.graphics = lib.optionalAttrs (lib.versionOlder lib.version "24.11pre") { + enable = lib.mkOption { + type = lib.types.bool; + default = false; + }; + enable32Bit = lib.mkOption { + type = lib.types.bool; + default = false; + }; + extraPackages = lib.mkOption { + type = lib.types.listOf lib.types.package; + default = []; + }; + extraPackages32 = lib.mkOption { + type = lib.types.listOf lib.types.package; + default = []; + }; + }; + }; + + config = { + hardware.opengl = lib.optionalAttrs (lib.versionOlder lib.version "24.11pre") { + enable = config.hardware.graphics.enable; + driSupport32Bit = config.hardware.graphics.enable32Bit; + extraPackages = config.hardware.graphics.extraPackages; + extraPackages32 = config.hardware.graphics.extraPackages32; + }; + }; +} diff --git a/common/gpu/amd/default.nix b/common/gpu/amd/default.nix index 9228bc3..f4bd7f1 100644 --- a/common/gpu/amd/default.nix +++ b/common/gpu/amd/default.nix @@ -7,6 +7,7 @@ default = true; }; + imports = [ ../24.05-compat.nix ]; config = lib.mkMerge [ { services.xserver.videoDrivers = lib.mkDefault [ "modesetting" ]; diff --git a/common/gpu/intel/default.nix b/common/gpu/intel/default.nix index 90afad1..b5c0dcd 100644 --- a/common/gpu/intel/default.nix +++ b/common/gpu/intel/default.nix @@ -5,6 +5,7 @@ ... }: { + imports = [ ../24.05-compat.nix ]; options.hardware.intelgpu.driver = lib.mkOption { description = "Intel GPU driver to use"; type = lib.types.enum [ diff --git a/common/gpu/nvidia/default.nix b/common/gpu/nvidia/default.nix index 43b4608..6141aaf 100644 --- a/common/gpu/nvidia/default.nix +++ b/common/gpu/nvidia/default.nix @@ -1,6 +1,7 @@ { lib, pkgs, ... }: { + imports = [ ../24.05-compat.nix ]; services.xserver.videoDrivers = lib.mkDefault [ "nvidia" ]; hardware.graphics.extraPackages = with pkgs; [ vaapiVdpau diff --git a/dell/precision/7520/default.nix b/dell/precision/7520/default.nix index db5626f..59fa95e 100644 --- a/dell/precision/7520/default.nix +++ b/dell/precision/7520/default.nix @@ -1,8 +1,6 @@ { config, lib, - pkgs, - inputs, ... }: { imports = [ diff --git a/gpd/pocket-3/default.nix b/gpd/pocket-3/default.nix index 73d2bed..1ed95eb 100644 --- a/gpd/pocket-3/default.nix +++ b/gpd/pocket-3/default.nix @@ -6,6 +6,7 @@ in ../../common/pc/laptop ../../common/pc/laptop/ssd ../../common/hidpi.nix + ../../common/gpu/24.05-compat.nix ]; # Necessary kernel modules diff --git a/lenovo/thinkpad/p1/3th-gen/nvidia.nix b/lenovo/thinkpad/p1/3th-gen/nvidia.nix index 6f939e9..ae19167 100644 --- a/lenovo/thinkpad/p1/3th-gen/nvidia.nix +++ b/lenovo/thinkpad/p1/3th-gen/nvidia.nix @@ -1,5 +1,8 @@ { lib, ... }: { + imports = [ + ../../../../common/gpu/24.05-compat.nix + ]; hardware = { graphics = { enable = lib.mkDefault true; diff --git a/lenovo/thinkpad/p51/default.nix b/lenovo/thinkpad/p51/default.nix index ca86455..9128970 100644 --- a/lenovo/thinkpad/p51/default.nix +++ b/lenovo/thinkpad/p51/default.nix @@ -1,5 +1,6 @@ { config, lib, ... }: { imports = [ + ../../../common/gpu/24.05-compat.nix ../../../common/gpu/nvidia/prime.nix ../../../common/cpu/intel ../../../common/cpu/intel/kaby-lake diff --git a/lenovo/thinkpad/p52/default.nix b/lenovo/thinkpad/p52/default.nix index e768923..2f6676a 100644 --- a/lenovo/thinkpad/p52/default.nix +++ b/lenovo/thinkpad/p52/default.nix @@ -1,5 +1,6 @@ { lib, config, ... }: { imports = [ + ../../../common/gpu/24.05-compat.nix ../../../common/gpu/nvidia/prime.nix ../../../common/cpu/intel ../../../common/pc/laptop/acpi_call.nix diff --git a/lenovo/yoga/6/13ALC6/default.nix b/lenovo/yoga/6/13ALC6/default.nix index 1177bc7..78784c7 100644 --- a/lenovo/yoga/6/13ALC6/default.nix +++ b/lenovo/yoga/6/13ALC6/default.nix @@ -4,6 +4,7 @@ imports = [ ../../../thinkpad/yoga.nix ../../../../common/gpu/amd/default.nix + ../../../../common/gpu/24.05-compat.nix ]; boot.initrd.kernelModules = [ "ideapad_laptop" ]; diff --git a/lenovo/yoga/7/14ARH7/amdgpu/default.nix b/lenovo/yoga/7/14ARH7/amdgpu/default.nix index 6630911..454a914 100644 --- a/lenovo/yoga/7/14ARH7/amdgpu/default.nix +++ b/lenovo/yoga/7/14ARH7/amdgpu/default.nix @@ -8,6 +8,7 @@ let in { imports = [ ../shared.nix + ../../../../../common/gpu/24.05-compat.nix ]; # AMD RX680 diff --git a/tests/run.py b/tests/run.py index 07a86c0..ec8d8ce 100755 --- a/tests/run.py +++ b/tests/run.py @@ -81,7 +81,7 @@ def write_eval_test(f: IO[str], profiles: list[str]) -> None: continue system = "x86_64-linux" - if "raspberry-pi/4" == profile or "raspberry-pi/5" == profile: + if profile in ("raspberry-pi/4", "raspberry-pi/5"): system = "aarch64-linux" f.write( From 4e59e4c9e9fed47dc0517041eac0deb16711d9b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sat, 22 Jun 2024 08:42:43 +0200 Subject: [PATCH 57/88] common/gpu/24.05-compat: don't create conflicts with user configuration fixes https://github.com/NixOS/nixos-hardware/issues/1000 --- common/gpu/24.05-compat.nix | 36 ++++++------------------------------ 1 file changed, 6 insertions(+), 30 deletions(-) diff --git a/common/gpu/24.05-compat.nix b/common/gpu/24.05-compat.nix index ca53247..3e3495f 100644 --- a/common/gpu/24.05-compat.nix +++ b/common/gpu/24.05-compat.nix @@ -1,37 +1,13 @@ { - config, lib, ... }: { # Backward-compat for 24.05, can be removed after we drop 24.05 support - options = { - hardware.graphics = lib.optionalAttrs (lib.versionOlder lib.version "24.11pre") { - enable = lib.mkOption { - type = lib.types.bool; - default = false; - }; - enable32Bit = lib.mkOption { - type = lib.types.bool; - default = false; - }; - extraPackages = lib.mkOption { - type = lib.types.listOf lib.types.package; - default = []; - }; - extraPackages32 = lib.mkOption { - type = lib.types.listOf lib.types.package; - default = []; - }; - }; - }; - - config = { - hardware.opengl = lib.optionalAttrs (lib.versionOlder lib.version "24.11pre") { - enable = config.hardware.graphics.enable; - driSupport32Bit = config.hardware.graphics.enable32Bit; - extraPackages = config.hardware.graphics.extraPackages; - extraPackages32 = config.hardware.graphics.extraPackages32; - }; - }; + imports = lib.optionals (lib.versionOlder lib.version "24.11pre") [ + (lib.mkAliasOptionModule [ "hardware" "graphics" "enable" ] [ "hardware" "opengl" "enable" ]) + (lib.mkAliasOptionModule [ "hardware" "graphics" "extraPackages" ] [ "hardware" "opengl" "extraPackages" ]) + (lib.mkAliasOptionModule [ "hardware" "graphics" "extraPackages32" ] [ "hardware" "opengl" "extraPackages32" ]) + (lib.mkAliasOptionModule [ "hardware" "graphics" "enable32Bit" ] [ "hardware" "opengl" "driSupport32Bit" ]) + ]; } From 7d87afd10b176dee02376c476cb916eb33e23d8b Mon Sep 17 00:00:00 2001 From: Flameopathic Date: Sat, 22 Jun 2024 13:51:28 -0400 Subject: [PATCH 58/88] feat: spi thermal conf --- .../surface/surface-pro-intel/default.nix | 7 ++++- .../surface-pro-intel/thermal-conf.xml | 27 +++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 microsoft/surface/surface-pro-intel/thermal-conf.xml diff --git a/microsoft/surface/surface-pro-intel/default.nix b/microsoft/surface/surface-pro-intel/default.nix index 026843a..2cfa95d 100644 --- a/microsoft/surface/surface-pro-intel/default.nix +++ b/microsoft/surface/surface-pro-intel/default.nix @@ -1,4 +1,4 @@ -{ ... }: +{ lib, ... }: # This module is intended to support the Surface Pro range, specifically those with Intel CPUs. # It's expected it will work equally well on many other Surface models, but they may need further @@ -15,4 +15,9 @@ microsoft-surface.ipts.enable = true; microsoft-surface.surface-control.enable = true; + + services.thermald = lib.mkDefault { + enable = true; + configFile = ./thermal-conf.xml; + }; } diff --git a/microsoft/surface/surface-pro-intel/thermal-conf.xml b/microsoft/surface/surface-pro-intel/thermal-conf.xml new file mode 100644 index 0000000..459ef81 --- /dev/null +++ b/microsoft/surface/surface-pro-intel/thermal-conf.xml @@ -0,0 +1,27 @@ + + + + Surface Pro Intel Thermal Workaround + * + QUIET + + + cpu + + + x86_pkg_temp + 65000 + passive + SEQUENTIAL + + 1 + rapl_controller + 100 + 10 + + + + + + + From 0cf592f520a4cbb6e8b4e84e38988bee5e939cab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sun, 23 Jun 2024 13:59:30 +0200 Subject: [PATCH 59/88] add new tests to mergify configuration --- .github/workflows/test.yml | 1 + .mergify.yml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7c67a21..9d1999e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,6 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: + # when updating channels, also update .mergify.yml channel: [ nixos-unstable, nixos-24.05 ] steps: - uses: actions/checkout@v4 diff --git a/.mergify.yml b/.mergify.yml index 45ffb1e..dc3bf77 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -1,7 +1,8 @@ queue_rules: - name: default merge_conditions: - - check-success=tests + - check-success=tests (nixos-24.05) + - check-success=tests (nixos-unstable) defaults: actions: queue: From c3e48cbd88414f583ff08804eb57b0da4c194f9e Mon Sep 17 00:00:00 2001 From: "Paepcke, Michael" Date: Sun, 23 Jun 2024 11:28:59 +0200 Subject: [PATCH 60/88] update macbookpro14,1 to 24.01 (2024) --- apple/macbook-pro/14-1/README.md | 35 +++++---- apple/macbook-pro/14-1/default.nix | 112 +++++++++++++++++++---------- 2 files changed, 97 insertions(+), 50 deletions(-) diff --git a/apple/macbook-pro/14-1/README.md b/apple/macbook-pro/14-1/README.md index a8941d1..0a0e2df 100644 --- a/apple/macbook-pro/14-1/README.md +++ b/apple/macbook-pro/14-1/README.md @@ -1,17 +1,26 @@ -# MacBook Pro 14,1 +# MacBook Pro 14,1, NixOS 24.01 (2024) ## Audio - -Audio is a lost cause. Bribe an Apple or Cirrus engineer for the datasheet. ;) - -## Thunderbolt - -The thunderbolt module will oops upon system resume, and subsequently refuse to work until next reboot. - -## Suspend/Resume - -The d3cold state needs to be disabled on the NVME controller for it to wake up. + [ ] Still broken, use usb/hdmi instead, nixos pkg needed: https://github.com/davidjo/snd_hda_macbookpro ## Bluetooth -The Bluetooth UART (/dev/ttyS0) is created and then deleted by udev in early boot. -Hack around it by reloading the 8250_dw module, causing it to be re-created. + [ ] Still broken, even (hacky) workaround does not work any more with latest driver updates + +## Touchpad + [x] Working, including 'disable while typing' usable quirk + +## Thunderbolt + [x] Working + +## NVME + [x] Working, older NVME / Controller may need workaround for resume + +## Suspend/Resume + [ ] Thunderbolt, WIFI, NVME may still need reboot (sometimes). + +## Wifi + [x] Working (2,4Ghz & 5Ghz supported), WEP3 currently broken b/c old brcm fw + +## Resources +- https://github.com/Dunedan/mbp-2016-linux?tab=readme-ov-file +- https://gist.github.com/roadrunner2/1289542a748d9a104e7baec6a92f9cd7 diff --git a/apple/macbook-pro/14-1/default.nix b/apple/macbook-pro/14-1/default.nix index 6b1fd74..54a6e84 100644 --- a/apple/macbook-pro/14-1/default.nix +++ b/apple/macbook-pro/14-1/default.nix @@ -1,51 +1,89 @@ -{ config, lib, pkgs, ... }: - { + config, + lib, + pkgs, + ... +}: { imports = [ - ../. + ../../../common/cpu/intel/kaby-lake + ../../../common/gpu/intel + ../../../common/hidpi.nix + ../../../common/pc/laptop ../../../common/pc/laptop/ssd + ../../../common/pc/laptop/acpi_call.nix ]; - ## - # Make the keyboard work in stage1 + # Make the keyboard work in stage1, enable iommu # https://www.kernelconfig.io/config_keyboard_applespi - ## - boot.initrd.kernelModules = [ "applespi" "spi_pxa2xx_platform" "intel_lpss_pci" "applesmc" ]; - boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.0") pkgs.linuxPackages_latest; - - ## - # Disable d3cold on the NVME controller so the machine can actually - # wake up. - # https://github.com/Dunedan/mbp-2016-linux - ## - systemd.services.disable-nvme-d3cold = { - description = "Disables d3cold on the NVME controller"; - before = [ "suspend.target" ]; - path = [ pkgs.bash pkgs.coreutils ]; - - serviceConfig.Type = "oneshot"; - serviceConfig.ExecStart = "${./disable-nvme-d3cold.sh}"; - serviceConfig.TimeoutSec = 0; - - wantedBy = [ "multi-user.target" "suspend.target" ]; + boot = { + initrd.kernelModules = ["applespi" "spi_pxa2xx_platform" "intel_lpss_pci" "applesmc" ]; + kernelParams = [ "intel_iommu=on" ]; + kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.0") pkgs.linuxPackages_latest; }; - ## + # Touchpad quirks to make "disable-while-typing" actually work + services.libinput.enable = true; + environment.etc."libinput/local-overrides.quirks".text = '' + [MacBook(Pro) SPI Touchpads] + MatchName=*Apple SPI Touchpad* + ModelAppleTouchpad=1 + AttrTouchSizeRange=200:150 + AttrPalmSizeThreshold=1100 + + [MacBook(Pro) SPI Keyboards] + MatchName=*Apple SPI Keyboard* + AttrKeyboardIntegration=internal + + [MacBookPro Touchbar] + MatchBus=usb + MatchVendor=0x05AC + MatchProduct=0x8600 + AttrKeyboardIntegration=internal + ''; + + # Wifi, CPU Microcode FW updates + networking.enableB43Firmware = lib.mkDefault true; + hardware = { + enableRedistributableFirmware = lib.mkDefault true; + cpu.intel.updateMicrocode = lib.mkDefault true; + }; + + # Bluetooth, only needed if kernel lacks support - custom kernel build + # boot.kernelPatches = [ + # { + # name = "bcrm-config"; + # patch = null; + # extraConfig = '' + # BT_HCIUART_BCM y ''; + # } + # ]; + + ## [Workaround seems not to work anymore! Any Ideas?] # For some reason /dev/ttyS0 is created, and then removed by udev. We need this # for bluetooth, and the only way to get it again is to reload 8502_dw. Luckily, # nothing else uses it. + ## + # systemd.services.btattach-bcm2e7c = lib.mkIf config.hardware.bluetooth.enable { + # before = [ "bluetooth.target" ]; + # after = [ "sys-devices-platform-serial8250-tty-ttyS1.device" ]; + # path = [ pkgs.bash pkgs.kmod pkgs.bluez ]; + # serviceConfig.Type = "simple"; + # serviceConfig.ExecStart = "${./btfix.sh}"; + # wantedBy = [ "multi-user.target" ]; + # }; + + ## [Enable only if needed!] + # Disable d3cold on older NVME controller, only if needed + # https://github.com/Dunedan/mbp-2016-linux ## - systemd.services.btattach-bcm2e7c = lib.mkIf config.hardware.bluetooth.enable { - before = [ "bluetooth.target" ]; - - # Hacky, as it's a different device, but this always comes after ttyS0 - after = [ "sys-devices-platform-serial8250-tty-ttyS1.device" ]; - path = [ pkgs.bash pkgs.kmod pkgs.bluez ]; - - serviceConfig.Type = "simple"; - serviceConfig.ExecStart = "${./btfix.sh}"; - - wantedBy = [ "multi-user.target" ]; - }; + #systemd.services.disable-nvme-d3cold = { + # description = "Disables d3cold on the NVME controller"; + # before = [ "suspend.target" ]; + # path = [ pkgs.bash pkgs.coreutils ]; + # serviceConfig.Type = "oneshot"; + # serviceConfig.ExecStart = "${./disable-nvme-d3cold.sh}"; + # serviceConfig.TimeoutSec = 0; + # wantedBy = [ "multi-user.target" "suspend.target" ]; + #}; } From caabc425565bbd5c8640630b0bf6974961a49242 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20N=C3=BCtzi?= Date: Mon, 24 Jun 2024 17:53:36 +0200 Subject: [PATCH 61/88] feat: Update CODEOWNERS for Tuxedo Pulse Laptops --- CODEOWNERS | 1 + 1 file changed, 1 insertion(+) diff --git a/CODEOWNERS b/CODEOWNERS index 69fa782..4525d6b 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -11,3 +11,4 @@ purism/librem/13v3 @yegortimoshenko system76/darp6 @khumba framework @emiller88 tuxedo/pulse/15/gen2 @trueNAHO +tuxedo/pulse/14/gen3 @gabyx @britter @trueNAHO From 1a59c3d5ac53ed9266eba2bd65b09e6bfcc9ad7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20N=C3=BCtzi?= Date: Mon, 24 Jun 2024 08:31:05 +0200 Subject: [PATCH 62/88] fix: Improve doc for Tuxedo Pulse Gen3 power issues --- tuxedo/pulse/14/gen3/README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tuxedo/pulse/14/gen3/README.md b/tuxedo/pulse/14/gen3/README.md index a44b5b3..959ab83 100644 --- a/tuxedo/pulse/14/gen3/README.md +++ b/tuxedo/pulse/14/gen3/README.md @@ -5,3 +5,22 @@ [NixOS hardware configuration](https://github.com/NixOS/nixos-hardware) for [TUXEDO Pulse 14 - Gen3](https://www.tuxedocomputers.com/en/TUXEDO-Pulse-14-Gen3). + +## Troubleshooting + +### Shutdown and Power Issues + +With the Linux Kernel version `6.6.33` (NixOS 24.05) there are shutdown issues resulting in the battery not turning off +completely. Apparently a newer Kernel (tested with `6.8.12`) fixes this (the exact version where this problem is fixed is unknown). + +You can use + +```nix + boot.kernelPackages = + if (config.boot.zfs.enabled) + then pkgs.zfs.latestCompatibleLinuxPackages + else pkgs.linuxPackages_latest; +``` + +to use the latest Kernel, where `pkgs` should probably +be the `nixos-unstable` channel (`github:nixos/nixpkgs/nixos-unstable`). From aab67495e34365045f9dfbe58725cc6fa03607b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20N=C3=BCtzi?= Date: Tue, 25 Jun 2024 22:08:33 +0200 Subject: [PATCH 63/88] fix: Add an upgrade --- tuxedo/pulse/14/gen3/README.md | 13 +------------ tuxedo/pulse/14/gen3/default.nix | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/tuxedo/pulse/14/gen3/README.md b/tuxedo/pulse/14/gen3/README.md index 959ab83..e419ae4 100644 --- a/tuxedo/pulse/14/gen3/README.md +++ b/tuxedo/pulse/14/gen3/README.md @@ -12,15 +12,4 @@ Gen3](https://www.tuxedocomputers.com/en/TUXEDO-Pulse-14-Gen3). With the Linux Kernel version `6.6.33` (NixOS 24.05) there are shutdown issues resulting in the battery not turning off completely. Apparently a newer Kernel (tested with `6.8.12`) fixes this (the exact version where this problem is fixed is unknown). - -You can use - -```nix - boot.kernelPackages = - if (config.boot.zfs.enabled) - then pkgs.zfs.latestCompatibleLinuxPackages - else pkgs.linuxPackages_latest; -``` - -to use the latest Kernel, where `pkgs` should probably -be the `nixos-unstable` channel (`github:nixos/nixpkgs/nixos-unstable`). +This `default.nix` will upgrade to the `pkgs.linuxPackages_latest` if the kernel is older than `6.8.12`. diff --git a/tuxedo/pulse/14/gen3/default.nix b/tuxedo/pulse/14/gen3/default.nix index f43fbb0..fb4aa24 100644 --- a/tuxedo/pulse/14/gen3/default.nix +++ b/tuxedo/pulse/14/gen3/default.nix @@ -1,4 +1,9 @@ -{pkgs, ...}: { +{ + lib, + pkgs, + config, + ... +}: { imports = [ ../../../../common/cpu/amd ../../../../common/cpu/amd/pstate.nix @@ -6,4 +11,14 @@ ../../../../common/pc/laptop ../../../../common/pc/laptop/ssd ]; + + # Fixing a power-issue with older kernels. + # When powered off, the battery does not turn off completely. + # Kernel 6.8.12 fixes this, + # the exact version is still unknown which fixed this. + boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.8.12") ( + if (config.boot.zfs.enabled) + then pkgs.zfs.latestCompatibleLinuxPackages + else pkgs.linuxPackages_latest + ); } From f140ca626b8d10a584c1db3c3f9df9e7c57b843d Mon Sep 17 00:00:00 2001 From: pinage404 Date: Tue, 25 Jun 2024 00:47:39 +0200 Subject: [PATCH 64/88] Dell Optiplex 3050: init --- README.md | 1 + dell/optiplex/3050/default.nix | 7 +++++++ flake.nix | 1 + 3 files changed, 9 insertions(+) create mode 100644 dell/optiplex/3050/default.nix diff --git a/README.md b/README.md index 8b794dc..c0f6dc5 100644 --- a/README.md +++ b/README.md @@ -118,6 +118,7 @@ See code for all available configurations. | [Dell Latitude 7430](dell/latitude/7430) | `` | | [Dell Latitude 7490](dell/latitude/7490) | `` | | [Dell Latitude 9430](dell/latitude/9430) | `` | +| [Dell Optiplex 3050](dell/optiplex/3050) | `` | | [Dell Poweredge R7515](dell/poweredge/r7515) | `` | | [Dell Precision 3541](dell/precision/3541) | `` | | [Dell Precision 5530](dell/precision/5530) | `` | diff --git a/dell/optiplex/3050/default.nix b/dell/optiplex/3050/default.nix new file mode 100644 index 0000000..888030e --- /dev/null +++ b/dell/optiplex/3050/default.nix @@ -0,0 +1,7 @@ +{ + imports = [ + ../../../common/cpu/intel + ../../../common/pc + ../../../common/pc/ssd + ]; +} diff --git a/flake.nix b/flake.nix index a34fe9e..159e2d1 100644 --- a/flake.nix +++ b/flake.nix @@ -48,6 +48,7 @@ dell-latitude-7430 = import ./dell/latitude/7430; dell-latitude-7490 = import ./dell/latitude/7490; dell-latitude-9430 = import ./dell/latitude/9430; + dell-optiplex-3050 = import ./dell/optiplex/3050; dell-poweredge-r7515 = import ./dell/poweredge/r7515; dell-precision-3541 = import ./dell/precision/3541; dell-precision-5530 = import ./dell/precision/5530; From ae13b3761c4994579b7d334e9d425096f411647c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 26 Jun 2024 08:30:58 +0200 Subject: [PATCH 65/88] lenovo/yoga/6/13ALC6: drop video acceleration driver Those are not useful for AMD. According to https://wiki.nixos.org/wiki/Accelerated_Video_Playback all we need is enabling opengl drivers. --- lenovo/yoga/6/13ALC6/default.nix | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lenovo/yoga/6/13ALC6/default.nix b/lenovo/yoga/6/13ALC6/default.nix index 78784c7..39f8233 100644 --- a/lenovo/yoga/6/13ALC6/default.nix +++ b/lenovo/yoga/6/13ALC6/default.nix @@ -4,14 +4,9 @@ imports = [ ../../../thinkpad/yoga.nix ../../../../common/gpu/amd/default.nix - ../../../../common/gpu/24.05-compat.nix ]; boot.initrd.kernelModules = [ "ideapad_laptop" ]; - hardware.graphics.extraPackages = with pkgs; [ - vaapiVdpau - libvdpau-va-gl - ]; # latest kernel needed to make wifi work boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.16") pkgs.linuxPackages_latest; From 4677bf5e89551d05f7983f2691590b0f7ab1a63a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 26 Jun 2024 08:47:50 +0200 Subject: [PATCH 66/88] gpu/intel: remove outdated libvdpau-va-gl driver the existing drivers should provide video accelerations since broadwell. This driver also caused a crash in the past in VLC: https://github.com/NixOS/nixpkgs/issues/283083 --- common/gpu/intel/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/common/gpu/intel/default.nix b/common/gpu/intel/default.nix index b5c0dcd..be5a8c8 100644 --- a/common/gpu/intel/default.nix +++ b/common/gpu/intel/default.nix @@ -37,7 +37,6 @@ else intel-vaapi-driver ) - libvdpau-va-gl intel-media-driver ]; @@ -48,7 +47,6 @@ else intel-vaapi-driver ) - libvdpau-va-gl intel-media-driver ]; From 5fe1583567b2ec9f4f7f7547bed809b08bfebd89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 26 Jun 2024 08:54:34 +0200 Subject: [PATCH 67/88] gpu/amd: remove unused pkgs --- common/gpu/amd/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/gpu/amd/default.nix b/common/gpu/amd/default.nix index f4bd7f1..ca103fc 100644 --- a/common/gpu/amd/default.nix +++ b/common/gpu/amd/default.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, ... }: { options.hardware.amdgpu.loadInInitrd = lib.mkEnableOption (lib.mdDoc From a5abf3379dc986f6952cc8c6999ddc1bf9d0ee13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 26 Jun 2024 08:55:30 +0200 Subject: [PATCH 68/88] zephyrus/ga402x: switch to amd gpu module --- asus/zephyrus/ga402x/amdgpu/default.nix | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/asus/zephyrus/ga402x/amdgpu/default.nix b/asus/zephyrus/ga402x/amdgpu/default.nix index b1791d7..2610db8 100644 --- a/asus/zephyrus/ga402x/amdgpu/default.nix +++ b/asus/zephyrus/ga402x/amdgpu/default.nix @@ -1,17 +1,15 @@ { config, lib, - pkgs, ... }: let - inherit (lib) mkDefault mkEnableOption mkIf mkMerge; + inherit (lib) mkEnableOption mkIf mkMerge; cfg = config.hardware.asus.zephyrus.ga402x; in { imports = [ ../shared.nix - ../../../../common/gpu/24.05-compat.nix ]; options.hardware.asus.zephyrus.ga402x.amdgpu = { @@ -21,19 +19,6 @@ in { }; config = mkMerge [ - { - # AMD RX680 - services.xserver.videoDrivers = mkDefault [ "amdgpu" ]; - - hardware = { - amdgpu.loadInInitrd = true; - graphics.extraPackages = with pkgs; [ - vaapiVdpau - libvdpau-va-gl - ]; - }; - } - (mkIf cfg.amdgpu.recovery.enable { # Hopefully fixes for where the kernel sometimes hangs when suspending or hibernating # (Though, I'm very suspicious of the Mediatek Wifi...) From b7d8d5c78812a0a82fdfc817208e530d476d2313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 26 Jun 2024 09:29:56 +0200 Subject: [PATCH 69/88] lenovo/yoga/7/14ARH7: remove redundant vdpau packages amd doesn't need them and nvidia already includes them --- lenovo/yoga/7/14ARH7/amdgpu/default.nix | 26 +++---------------------- lenovo/yoga/7/14ARH7/nvidia/default.nix | 4 ---- 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/lenovo/yoga/7/14ARH7/amdgpu/default.nix b/lenovo/yoga/7/14ARH7/amdgpu/default.nix index 454a914..a23307a 100644 --- a/lenovo/yoga/7/14ARH7/amdgpu/default.nix +++ b/lenovo/yoga/7/14ARH7/amdgpu/default.nix @@ -1,24 +1,4 @@ -# Including this file will enable the AMD-GPU driver - -{ lib, pkgs, ... }: - -let - inherit (lib) mkDefault; - -in { - imports = [ - ../shared.nix - ../../../../../common/gpu/24.05-compat.nix - ]; - - # AMD RX680 - services.xserver.videoDrivers = mkDefault [ "amdgpu" ]; - - hardware = { - amdgpu.loadInInitrd = true; - graphics.extraPackages = with pkgs; [ - vaapiVdpau - libvdpau-va-gl - ]; - }; +# Including this file will enable the AMD-GPU driver (in shared.nix) +{ + imports = [ ../shared.nix ]; } diff --git a/lenovo/yoga/7/14ARH7/nvidia/default.nix b/lenovo/yoga/7/14ARH7/nvidia/default.nix index 6c97a07..9707745 100644 --- a/lenovo/yoga/7/14ARH7/nvidia/default.nix +++ b/lenovo/yoga/7/14ARH7/nvidia/default.nix @@ -19,10 +19,6 @@ in { hardware = { ## Enable the Nvidia card, as well as Prime and Offload: amdgpu.loadInInitrd = true; - graphics.extraPackages = with pkgs; [ - vaapiVdpau - libvdpau-va-gl - ]; nvidia = { modesetting.enable = true; From 901bc809b5d3e73a609a167385df23311d81b39c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 26 Jun 2024 09:34:50 +0200 Subject: [PATCH 70/88] asus/zephyrus/ga402x: drop redundand vdpau drivers --- asus/zephyrus/ga402x/nvidia/default.nix | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/asus/zephyrus/ga402x/nvidia/default.nix b/asus/zephyrus/ga402x/nvidia/default.nix index 73a2b9d..99dfa9b 100644 --- a/asus/zephyrus/ga402x/nvidia/default.nix +++ b/asus/zephyrus/ga402x/nvidia/default.nix @@ -12,6 +12,7 @@ in { ## "prime.nix" loads this, aleady: # ../../../common/gpu/nvidia ../../../../common/gpu/nvidia/prime.nix + ]; # NVIDIA GeForce RTX 4060 Mobile @@ -26,11 +27,6 @@ in { hardware = { ## Enable the Nvidia card, as well as Prime and Offload: amdgpu.loadInInitrd = true; - graphics.extraPackages = with pkgs; [ - # Also in nvidia/default.nix - vaapiVdpau - libvdpau-va-gl - ]; nvidia = { modesetting.enable = true; From 14aadcba1a26c8c142453839f888afd0db8b2041 Mon Sep 17 00:00:00 2001 From: x123 Date: Thu, 27 Jun 2024 12:05:59 +0200 Subject: [PATCH 71/88] common/gpu/nvidia: vaapiVdpau -> libva-vdpau-driver --- common/gpu/nvidia/default.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/common/gpu/nvidia/default.nix b/common/gpu/nvidia/default.nix index 6141aaf..01542ee 100644 --- a/common/gpu/nvidia/default.nix +++ b/common/gpu/nvidia/default.nix @@ -3,7 +3,11 @@ { imports = [ ../24.05-compat.nix ]; services.xserver.videoDrivers = lib.mkDefault [ "nvidia" ]; - hardware.graphics.extraPackages = with pkgs; [ - vaapiVdpau + hardware.graphics.extraPackages = [ + ( + if pkgs ? libva-vdpau-driver + then pkgs.libva-vdpau-driver + else pkgs.vaapiVdpau + ) ]; } From 3980e7816c99d9e4da7a7b762e5b294055b73b2f Mon Sep 17 00:00:00 2001 From: me00001 <37930867+me00001@users.noreply.github.com> Date: Fri, 28 Jun 2024 08:30:54 +0300 Subject: [PATCH 72/88] enable bluetooth support for Yoga 6 13ALC6. (#1013) Co-authored-by: Sandro --- lenovo/yoga/6/13ALC6/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lenovo/yoga/6/13ALC6/default.nix b/lenovo/yoga/6/13ALC6/default.nix index 39f8233..0acf508 100644 --- a/lenovo/yoga/6/13ALC6/default.nix +++ b/lenovo/yoga/6/13ALC6/default.nix @@ -13,4 +13,6 @@ # energy savings boot.kernelParams = ["mem_sleep_default=deep" "pcie_aspm.policy=powersupersave"]; + + hardware.bluetooth.enable = true; } From 231274268ff2250d4730e274b808f66ef91b6381 Mon Sep 17 00:00:00 2001 From: Lyndon Sanche Date: Wed, 26 Jun 2024 16:51:35 -0600 Subject: [PATCH 73/88] 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; From d11eeae7664006a07b0b9e8dbd6ea500c8b3dbdb Mon Sep 17 00:00:00 2001 From: pinage404 Date: Tue, 25 Jun 2024 01:07:34 +0200 Subject: [PATCH 74/88] Raspberry Pi 3: init --- README.md | 1 + flake.nix | 1 + raspberry-pi/3/default.nix | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 raspberry-pi/3/default.nix diff --git a/README.md b/README.md index c0f6dc5..8fe19dd 100644 --- a/README.md +++ b/README.md @@ -302,6 +302,7 @@ See code for all available configurations. | [Purism Librem 15v3](purism/librem/13v3) | `` | | [Purism Librem 5r4](purism/librem/5r4) | `` | | [Raspberry Pi 2](raspberry-pi/2) | `` | +| [Raspberry Pi 3](raspberry-pi/3) | `` | | [Raspberry Pi 4](raspberry-pi/4) | `` | | [Raspberry Pi 5](raspberry-pi/5) | `` | | [Samsung Series 9 NP900X3C](samsung/np900x3c) | `` | diff --git a/flake.nix b/flake.nix index 159e2d1..63c03f8 100644 --- a/flake.nix +++ b/flake.nix @@ -239,6 +239,7 @@ purism-librem-15v3 = import ./purism/librem/15v3; purism-librem-5r4 = import ./purism/librem/5r4; raspberry-pi-2 = import ./raspberry-pi/2; + raspberry-pi-3 = import ./raspberry-pi/3; raspberry-pi-4 = import ./raspberry-pi/4; raspberry-pi-5 = import ./raspberry-pi/5; kobol-helios4 = import ./kobol/helios4; diff --git a/raspberry-pi/3/default.nix b/raspberry-pi/3/default.nix new file mode 100644 index 0000000..d4eba12 --- /dev/null +++ b/raspberry-pi/3/default.nix @@ -0,0 +1,38 @@ +{ lib +, pkgs +, ... +}: + +{ + boot.kernelPackages = lib.mkDefault pkgs.linuxKernel.packages.linux_rpi3; + + # fix the following error : + # modprobe: FATAL: Module ahci not found in directory + # https://github.com/NixOS/nixpkgs/issues/154163#issuecomment-1350599022 + nixpkgs.overlays = [ + (_final: super: { + makeModulesClosure = x: + super.makeModulesClosure (x // { allowMissing = true; }); + }) + ]; + + # https://github.com/NixOS/nixpkgs/blob/b72bde7c4a1f9c9bf1a161f0c267186ce3c6483c/nixos/modules/installer/sd-card/sd-image-aarch64.nix#L12 + # Use the extlinux boot loader. (NixOS wants to enable GRUB by default) + boot.loader.grub.enable = lib.mkDefault false; + # Enables the generation of /boot/extlinux/extlinux.conf + boot.loader.generic-extlinux-compatible.enable = lib.mkDefault true; + + # The serial ports listed here are: + # - ttyS0: for Tegra (Jetson TX1) + # - ttyAMA0: for QEMU's -machine virt + # https://github.com/NixOS/nixpkgs/blob/b72bde7c4a1f9c9bf1a161f0c267186ce3c6483c/nixos/modules/installer/sd-card/sd-image-aarch64.nix#L19 + boot.kernelParams = [ + "console=ttyS0,115200n8" + "console=ttyAMA0,115200n8" + "console=tty0" + ]; + + environment.systemPackages = with pkgs; [ + libraspberrypi + ]; +} From 8d5e6d9278a2214cf1ec7cb04a4016b1184edc73 Mon Sep 17 00:00:00 2001 From: pinage404 Date: Wed, 26 Jun 2024 23:58:14 +0200 Subject: [PATCH 75/88] Raspberry Pi 3: try to fix tests --- tests/run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/run.py b/tests/run.py index ec8d8ce..6668b4e 100755 --- a/tests/run.py +++ b/tests/run.py @@ -81,7 +81,7 @@ def write_eval_test(f: IO[str], profiles: list[str]) -> None: continue system = "x86_64-linux" - if profile in ("raspberry-pi/4", "raspberry-pi/5"): + if profile in ("raspberry-pi/3", "raspberry-pi/4", "raspberry-pi/5"): system = "aarch64-linux" f.write( From 43ea86cc8c77dcb5f622766050f1c3315088c419 Mon Sep 17 00:00:00 2001 From: pinage404 Date: Fri, 28 Jun 2024 12:16:18 +0000 Subject: [PATCH 76/88] remove probably not necessary library MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jörg Thalheim --- raspberry-pi/3/default.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/raspberry-pi/3/default.nix b/raspberry-pi/3/default.nix index d4eba12..9d54c3c 100644 --- a/raspberry-pi/3/default.nix +++ b/raspberry-pi/3/default.nix @@ -32,7 +32,4 @@ "console=tty0" ]; - environment.systemPackages = with pkgs; [ - libraspberrypi - ]; } From a59f00f5ac65b19382617ba00f360f8bc07ed3ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sat, 29 Jun 2024 09:47:27 +0200 Subject: [PATCH 77/88] raspberry-pi/3: remove ttyAMA0 from console list --- raspberry-pi/3/default.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/raspberry-pi/3/default.nix b/raspberry-pi/3/default.nix index 9d54c3c..57da74a 100644 --- a/raspberry-pi/3/default.nix +++ b/raspberry-pi/3/default.nix @@ -22,13 +22,12 @@ # Enables the generation of /boot/extlinux/extlinux.conf boot.loader.generic-extlinux-compatible.enable = lib.mkDefault true; + # The last console argument in the list that linux can find at boot will receive kernel logs. # The serial ports listed here are: - # - ttyS0: for Tegra (Jetson TX1) - # - ttyAMA0: for QEMU's -machine virt - # https://github.com/NixOS/nixpkgs/blob/b72bde7c4a1f9c9bf1a161f0c267186ce3c6483c/nixos/modules/installer/sd-card/sd-image-aarch64.nix#L19 + # - ttyS0: serial + # - tty0: hdmi boot.kernelParams = [ "console=ttyS0,115200n8" - "console=ttyAMA0,115200n8" "console=tty0" ]; From 6e253f12b1009053eff5344be5e835f604bb64cd Mon Sep 17 00:00:00 2001 From: xenia Date: Tue, 2 Jul 2024 00:00:01 -0400 Subject: [PATCH 78/88] pine64/pinebook-pro: remove obsolete issue docs this issue has been fixed upstream since kernel 5.14, and per #882 this commit removes it entirely from the readme --- pine64/pinebook-pro/README.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/pine64/pinebook-pro/README.md b/pine64/pinebook-pro/README.md index b6c0811..c791634 100644 --- a/pine64/pinebook-pro/README.md +++ b/pine64/pinebook-pro/README.md @@ -32,14 +32,6 @@ https://github.com/NixOS/nixos-hardware/blob/6d1bd5bc2e8b9992a3f57e416ba50fbed55 HDMI over Type-C works only for the custom kernel and the audio dosen't work (it's an upstream problem). -#### `rockchipdrm` and `efifb` - -This can be worked around by booting with the `efifb=off` kernel command-line. - -This is already handled for you by this configuration. If using the generic -UEFI AArch64 iso, you will need to add the option yourself to the command-line -using GRUB. - #### _EFI_ and poweroff When booted using EFI, the system will not power off. It will stay seemingly From f75ab8b22cf73522330cd23c8312ead6fbca8093 Mon Sep 17 00:00:00 2001 From: Cassie Cheung Date: Sat, 6 Jul 2024 12:23:26 +0800 Subject: [PATCH 79/88] apple/t2: factor out kernel definition for improved readability --- apple/t2/pkgs/linux-t2.nix | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/apple/t2/pkgs/linux-t2.nix b/apple/t2/pkgs/linux-t2.nix index ea8fbdc..e6fa95a 100644 --- a/apple/t2/pkgs/linux-t2.nix +++ b/apple/t2/pkgs/linux-t2.nix @@ -2,6 +2,9 @@ , ... } @ args: let + version = "6.9.4"; + majorVersion = with lib; (elemAt (take 1 (splitVersion version)) 0); + patchRepo = fetchFromGitHub { owner = "t2linux"; repo = "linux-t2-patches"; @@ -9,8 +12,10 @@ let hash = "sha256-mwT4cuIBrz3tz8+fAxVKmnRtkPRp3lWmNbocuXCsm44="; }; - version = "6.9.4"; - majorVersion = with lib; (elemAt (take 1 (splitVersion version)) 0); + kernel = fetchzip { + url = "mirror://kernel/linux/kernel/v${majorVersion}.x/linux-${version}.tar.xz"; + hash = "sha256-8jC5DpPi6poig1gmJPIIZ2HMwQQt1kTK4PcvyYm+Hsg="; + }; in buildLinux (args // { inherit version; @@ -20,10 +25,7 @@ buildLinux (args // { modDirVersion = with lib; "${concatStringsSep "." (take 3 (splitVersion "${version}.0"))}"; src = runCommand "patched-source" {} '' - cp -r ${fetchzip { - url = "mirror://kernel/linux/kernel/v${majorVersion}.x/linux-${version}.tar.xz"; - hash = "sha256-8jC5DpPi6poig1gmJPIIZ2HMwQQt1kTK4PcvyYm+Hsg="; - }} $out + cp -r ${kernel} $out chmod -R u+w $out cd $out while read -r patch; do From c1cdb2f8282818808fd6e0726620c7cd54c8a260 Mon Sep 17 00:00:00 2001 From: Cassie Cheung Date: Sat, 6 Jul 2024 12:23:48 +0800 Subject: [PATCH 80/88] apple/t2: update patches repo ref --- apple/t2/pkgs/linux-t2.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apple/t2/pkgs/linux-t2.nix b/apple/t2/pkgs/linux-t2.nix index e6fa95a..4da2150 100644 --- a/apple/t2/pkgs/linux-t2.nix +++ b/apple/t2/pkgs/linux-t2.nix @@ -8,8 +8,8 @@ let patchRepo = fetchFromGitHub { owner = "t2linux"; repo = "linux-t2-patches"; - rev = "0ad2b3913f5484ba8e86b6965f5d88903464261d"; - hash = "sha256-mwT4cuIBrz3tz8+fAxVKmnRtkPRp3lWmNbocuXCsm44="; + rev = "47b4069221c0ee3b6db56ab1ea90ae89e2de26f3"; + hash = "sha256-1B5DbLdyKdswy2ERmWVyjojdazTDbMsS+Vz/mrTdoFY="; }; kernel = fetchzip { @@ -47,7 +47,6 @@ buildLinux (args // { HID_APPLETB_KBD = module; HID_APPLE = module; DRM_APPLETBDRM = module; - HID_APPLE_MAGIC_BACKLIGHT = module; HID_SENSOR_ALS = module; SND_PCM = module; STAGING = yes; From da0aa7b533d49e6319c603e07b46a5690082f65f Mon Sep 17 00:00:00 2001 From: Cassie Cheung Date: Sun, 7 Jul 2024 00:14:34 +0800 Subject: [PATCH 81/88] apple/t2: bump kernel to 6.9.8 --- apple/t2/pkgs/linux-t2.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apple/t2/pkgs/linux-t2.nix b/apple/t2/pkgs/linux-t2.nix index 4da2150..2691890 100644 --- a/apple/t2/pkgs/linux-t2.nix +++ b/apple/t2/pkgs/linux-t2.nix @@ -2,7 +2,7 @@ , ... } @ args: let - version = "6.9.4"; + version = "6.9.8"; majorVersion = with lib; (elemAt (take 1 (splitVersion version)) 0); patchRepo = fetchFromGitHub { @@ -14,7 +14,7 @@ let kernel = fetchzip { url = "mirror://kernel/linux/kernel/v${majorVersion}.x/linux-${version}.tar.xz"; - hash = "sha256-8jC5DpPi6poig1gmJPIIZ2HMwQQt1kTK4PcvyYm+Hsg="; + hash = "sha256-o67tasZu4qGQ7obw+BCgNfaLqDcT3SPqsa3kTzWjmfg="; }; in buildLinux (args // { From 00f9c4bb0628983bc017d7644f67d49ae66bdbfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20K=C3=BCndig?= <8600029+tobias-kuendig@users.noreply.github.com> Date: Wed, 3 Jul 2024 09:24:27 +0200 Subject: [PATCH 82/88] Fix Lenovo Thinkpad T14s not powering off --- lenovo/thinkpad/t14s/amd/gen4/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 lenovo/thinkpad/t14s/amd/gen4/default.nix diff --git a/lenovo/thinkpad/t14s/amd/gen4/default.nix b/lenovo/thinkpad/t14s/amd/gen4/default.nix new file mode 100644 index 0000000..d13eb4f --- /dev/null +++ b/lenovo/thinkpad/t14s/amd/gen4/default.nix @@ -0,0 +1,9 @@ +{ lib, pkgs, ... }: +{ + imports = [ + ../. + ]; + + # Fix laptop not properly powering off during shutdown. + boot.kernelParams = [ "apm=power_off" ]; +} From 72d3c007024ce47d838bb38693c8773812f54bf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20K=C3=BCndig?= <8600029+tobias-kuendig@users.noreply.github.com> Date: Mon, 8 Jul 2024 08:08:53 +0200 Subject: [PATCH 83/88] Added new model to flake.nix and README --- README.md | 1 + flake.nix | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 8fe19dd..de376d4 100644 --- a/README.md +++ b/README.md @@ -221,6 +221,7 @@ See code for all available configurations. | [Lenovo ThinkPad T14 AMD Gen 4](lenovo/thinkpad/t14/amd/gen4) | `` | | [Lenovo ThinkPad T14](lenovo/thinkpad/t14) | `` | | [Lenovo ThinkPad T14s AMD Gen 1](lenovo/thinkpad/t14s/amd/gen1) | `` | +| [Lenovo ThinkPad T14s AMD Gen 4](lenovo/thinkpad/t14s/amd/gen4) | `` | | [Lenovo ThinkPad T14s](lenovo/thinkpad/t14s) | `` | | [Lenovo ThinkPad T410](lenovo/thinkpad/t410) | `` | | [Lenovo ThinkPad T420](lenovo/thinkpad/t420) | `` | diff --git a/flake.nix b/flake.nix index 63c03f8..112e00e 100644 --- a/flake.nix +++ b/flake.nix @@ -154,6 +154,7 @@ lenovo-thinkpad-t14-amd-gen4 = import ./lenovo/thinkpad/t14/amd/gen4; lenovo-thinkpad-t14s = import ./lenovo/thinkpad/t14s; lenovo-thinkpad-t14s-amd-gen1 = import ./lenovo/thinkpad/t14s/amd/gen1; + lenovo-thinkpad-t14s-amd-gen4 = import ./lenovo/thinkpad/t14s/amd/gen4; lenovo-thinkpad-t410 = import ./lenovo/thinkpad/t410; lenovo-thinkpad-t420 = import ./lenovo/thinkpad/t420; lenovo-thinkpad-t430 = import ./lenovo/thinkpad/t430; From ba8294c0a1fc318ed4869bb63fd122c63881fff0 Mon Sep 17 00:00:00 2001 From: Lyndon Sanche Date: Fri, 28 Jun 2024 18:23:23 -0600 Subject: [PATCH 84/88] common: Move Intel generation-specific config from cpu to gpu These modules only included gpu configuration, so belong in that location. --- apple/macbook-air/4/default.nix | 2 +- apple/macbook-pro/14-1/default.nix | 2 +- asus/zenbook/ux371/default.nix | 2 +- common/{cpu => gpu}/intel/comet-lake/default.nix | 0 common/{cpu => gpu}/intel/elkhart-lake/default.nix | 0 common/{cpu => gpu}/intel/jasper-lake/default.nix | 0 common/{cpu => gpu}/intel/kaby-lake/default.nix | 0 common/{cpu => gpu}/intel/sandy-bridge/default.nix | 0 common/{cpu => gpu}/intel/tiger-lake/default.nix | 0 dell/inspiron/5509/default.nix | 2 +- dell/precision/7520/default.nix | 2 +- dell/xps/13-9360/default.nix | 2 +- dell/xps/13-9370/default.nix | 2 +- dell/xps/15-9560/default.nix | 2 +- dell/xps/15-9560/intel/default.nix | 2 +- dell/xps/15-9570/default.nix | 2 +- flake.nix | 6 +++--- google/pixelbook/default.nix | 2 +- gpd/p2-max/default.nix | 2 +- hardkernel/odroid-h3/default.nix | 2 +- hp/elitebook/2560p/default.nix | 2 +- hp/notebook/14-df0023/default.nix | 2 +- huawei/machc-wa/default.nix | 2 +- lenovo/thinkpad/e470/default.nix | 2 +- lenovo/thinkpad/l480/default.nix | 2 +- lenovo/thinkpad/p51/default.nix | 2 +- lenovo/thinkpad/t420/default.nix | 2 +- lenovo/thinkpad/t520/default.nix | 2 +- lenovo/thinkpad/w520/default.nix | 2 +- lenovo/thinkpad/x220/default.nix | 2 +- microsoft/surface/surface-go/default.nix | 2 +- protectli/vp4670/default.nix | 2 +- 32 files changed, 28 insertions(+), 28 deletions(-) rename common/{cpu => gpu}/intel/comet-lake/default.nix (100%) rename common/{cpu => gpu}/intel/elkhart-lake/default.nix (100%) rename common/{cpu => gpu}/intel/jasper-lake/default.nix (100%) rename common/{cpu => gpu}/intel/kaby-lake/default.nix (100%) rename common/{cpu => gpu}/intel/sandy-bridge/default.nix (100%) rename common/{cpu => gpu}/intel/tiger-lake/default.nix (100%) diff --git a/apple/macbook-air/4/default.nix b/apple/macbook-air/4/default.nix index 181a099..850ad8d 100644 --- a/apple/macbook-air/4/default.nix +++ b/apple/macbook-air/4/default.nix @@ -3,7 +3,7 @@ { imports = [ ../. - ../../../common/cpu/intel/sandy-bridge + ../../../common/gpu/intel/sandy-bridge ]; boot.kernelParams = [ diff --git a/apple/macbook-pro/14-1/default.nix b/apple/macbook-pro/14-1/default.nix index 54a6e84..c2b61f9 100644 --- a/apple/macbook-pro/14-1/default.nix +++ b/apple/macbook-pro/14-1/default.nix @@ -5,7 +5,7 @@ ... }: { imports = [ - ../../../common/cpu/intel/kaby-lake + ../../../common/gpu/intel/kaby-lake ../../../common/gpu/intel ../../../common/hidpi.nix ../../../common/pc/laptop diff --git a/asus/zenbook/ux371/default.nix b/asus/zenbook/ux371/default.nix index 8601e2b..4fcfb28 100644 --- a/asus/zenbook/ux371/default.nix +++ b/asus/zenbook/ux371/default.nix @@ -7,7 +7,7 @@ }: { imports = [ - ../../../common/cpu/intel/tiger-lake + ../../../common/gpu/intel/tiger-lake ../../../common/pc/laptop ../../../common/pc/laptop/ssd ../../battery.nix diff --git a/common/cpu/intel/comet-lake/default.nix b/common/gpu/intel/comet-lake/default.nix similarity index 100% rename from common/cpu/intel/comet-lake/default.nix rename to common/gpu/intel/comet-lake/default.nix diff --git a/common/cpu/intel/elkhart-lake/default.nix b/common/gpu/intel/elkhart-lake/default.nix similarity index 100% rename from common/cpu/intel/elkhart-lake/default.nix rename to common/gpu/intel/elkhart-lake/default.nix diff --git a/common/cpu/intel/jasper-lake/default.nix b/common/gpu/intel/jasper-lake/default.nix similarity index 100% rename from common/cpu/intel/jasper-lake/default.nix rename to common/gpu/intel/jasper-lake/default.nix diff --git a/common/cpu/intel/kaby-lake/default.nix b/common/gpu/intel/kaby-lake/default.nix similarity index 100% rename from common/cpu/intel/kaby-lake/default.nix rename to common/gpu/intel/kaby-lake/default.nix diff --git a/common/cpu/intel/sandy-bridge/default.nix b/common/gpu/intel/sandy-bridge/default.nix similarity index 100% rename from common/cpu/intel/sandy-bridge/default.nix rename to common/gpu/intel/sandy-bridge/default.nix diff --git a/common/cpu/intel/tiger-lake/default.nix b/common/gpu/intel/tiger-lake/default.nix similarity index 100% rename from common/cpu/intel/tiger-lake/default.nix rename to common/gpu/intel/tiger-lake/default.nix diff --git a/dell/inspiron/5509/default.nix b/dell/inspiron/5509/default.nix index e77c9fd..b199e92 100644 --- a/dell/inspiron/5509/default.nix +++ b/dell/inspiron/5509/default.nix @@ -1,7 +1,7 @@ { lib, ... }: { imports = [ - ../../../common/cpu/intel/tiger-lake + ../../../common/gpu/intel/tiger-lake ../../../common/pc/laptop ../../../common/pc/ssd ]; diff --git a/dell/precision/7520/default.nix b/dell/precision/7520/default.nix index 59fa95e..09f8592 100644 --- a/dell/precision/7520/default.nix +++ b/dell/precision/7520/default.nix @@ -4,7 +4,7 @@ ... }: { imports = [ - ../../../common/cpu/intel/kaby-lake + ../../../common/gpu/intel/kaby-lake ../../../common/pc/laptop ../../../common/pc/laptop/ssd ../../../common/gpu/nvidia diff --git a/dell/xps/13-9360/default.nix b/dell/xps/13-9360/default.nix index f1ea378..5c73b8b 100644 --- a/dell/xps/13-9360/default.nix +++ b/dell/xps/13-9360/default.nix @@ -1,6 +1,6 @@ { imports = [ - ../../../common/cpu/intel/kaby-lake + ../../../common/gpu/intel/kaby-lake ../../../common/pc/laptop ]; diff --git a/dell/xps/13-9370/default.nix b/dell/xps/13-9370/default.nix index 10362b3..62dddc5 100644 --- a/dell/xps/13-9370/default.nix +++ b/dell/xps/13-9370/default.nix @@ -2,7 +2,7 @@ { imports = [ - ../../../common/cpu/intel/kaby-lake + ../../../common/gpu/intel/kaby-lake ../../../common/pc/laptop ../../../common/pc/laptop/acpi_call.nix ]; diff --git a/dell/xps/15-9560/default.nix b/dell/xps/15-9560/default.nix index 49e36b1..aee5665 100644 --- a/dell/xps/15-9560/default.nix +++ b/dell/xps/15-9560/default.nix @@ -1,7 +1,7 @@ { imports = [ ../../../common/cpu/intel - ../../../common/cpu/intel/kaby-lake + ../../../common/gpu/intel/kaby-lake ../../../common/pc/laptop ./xps-common.nix diff --git a/dell/xps/15-9560/intel/default.nix b/dell/xps/15-9560/intel/default.nix index 22de3bc..a77cb82 100644 --- a/dell/xps/15-9560/intel/default.nix +++ b/dell/xps/15-9560/intel/default.nix @@ -1,7 +1,7 @@ { imports = [ ../../../../common/cpu/intel - ../../../../common/cpu/intel/kaby-lake + ../../../../common/gpu/intel/kaby-lake ../../../../common/pc/laptop ../../../../common/gpu/nvidia/disable.nix ../xps-common.nix diff --git a/dell/xps/15-9570/default.nix b/dell/xps/15-9570/default.nix index 200dc09..9ef1a89 100644 --- a/dell/xps/15-9570/default.nix +++ b/dell/xps/15-9570/default.nix @@ -2,7 +2,7 @@ { imports = [ ../../../common/cpu/intel - ../../../common/cpu/intel/kaby-lake + ../../../common/gpu/intel/kaby-lake ../../../common/pc/laptop ./xps-common.nix ]; diff --git a/flake.nix b/flake.nix index 112e00e..6072c4f 100644 --- a/flake.nix +++ b/flake.nix @@ -266,10 +266,10 @@ common-cpu-amd-zenpower = import ./common/cpu/amd/zenpower.nix; common-cpu-amd-raphael-igpu = import ./common/cpu/amd/raphael/igpu.nix; common-cpu-intel = import ./common/cpu/intel; - common-cpu-intel-comet-lake = import ./common/cpu/intel/comet-lake; + common-gpu-intel-comet-lake = import ./common/gpu/intel/comet-lake; common-cpu-intel-cpu-only = import ./common/cpu/intel/cpu-only.nix; - common-cpu-intel-kaby-lake = import ./common/cpu/intel/kaby-lake; - common-cpu-intel-sandy-bridge = import ./common/cpu/intel/sandy-bridge; + common-gpu-intel-kaby-lake = import ./common/gpu/intel/kaby-lake; + common-gpu-intel-sandy-bridge = import ./common/gpu/intel/sandy-bridge; common-gpu-amd = import ./common/gpu/amd; common-gpu-amd-sea-islands = import ./common/gpu/amd/sea-islands; common-gpu-amd-southern-islands = import ./common/gpu/amd/southern-islands; diff --git a/google/pixelbook/default.nix b/google/pixelbook/default.nix index 1ea4c7a..0de52ed 100644 --- a/google/pixelbook/default.nix +++ b/google/pixelbook/default.nix @@ -4,6 +4,6 @@ imports = [ ../../common/pc/laptop ../../common/pc/laptop/ssd - ../../common/cpu/intel/kaby-lake + ../../common/gpu/intel/kaby-lake ]; } diff --git a/gpd/p2-max/default.nix b/gpd/p2-max/default.nix index f311864..2c02e17 100644 --- a/gpd/p2-max/default.nix +++ b/gpd/p2-max/default.nix @@ -3,7 +3,7 @@ ../../common/pc/laptop ../../common/pc/laptop/ssd ../../common/cpu/intel - ../../common/cpu/intel/kaby-lake + ../../common/gpu/intel/kaby-lake ../../common/hidpi.nix ]; } diff --git a/hardkernel/odroid-h3/default.nix b/hardkernel/odroid-h3/default.nix index e52d3a0..52d5819 100644 --- a/hardkernel/odroid-h3/default.nix +++ b/hardkernel/odroid-h3/default.nix @@ -1,5 +1,5 @@ { imports = [ - ../../common/cpu/intel/jasper-lake + ../../common/gpu/intel/jasper-lake ]; } diff --git a/hp/elitebook/2560p/default.nix b/hp/elitebook/2560p/default.nix index 3802337..ddcc6c3 100644 --- a/hp/elitebook/2560p/default.nix +++ b/hp/elitebook/2560p/default.nix @@ -3,7 +3,7 @@ with lib; { imports = [ ../../../common/cpu/intel - ../../../common/cpu/intel/sandy-bridge + ../../../common/gpu/intel/sandy-bridge ../../../common/pc ../../../common/pc/laptop ../../../common/pc/laptop/hdd diff --git a/hp/notebook/14-df0023/default.nix b/hp/notebook/14-df0023/default.nix index ca6e30d..b3cbfae 100644 --- a/hp/notebook/14-df0023/default.nix +++ b/hp/notebook/14-df0023/default.nix @@ -3,7 +3,7 @@ with lib; { imports = [ ../../../common/cpu/intel - ../../../common/cpu/intel/sandy-bridge + ../../../common/gpu/intel/sandy-bridge ../../../common/pc ../../../common/pc/laptop ../../../common/pc/laptop/hdd diff --git a/huawei/machc-wa/default.nix b/huawei/machc-wa/default.nix index e2bc0a8..d92a6a1 100644 --- a/huawei/machc-wa/default.nix +++ b/huawei/machc-wa/default.nix @@ -6,7 +6,7 @@ }: { imports = [ ../../common/cpu/intel - ../../common/cpu/intel/comet-lake + ../../common/gpu/intel/comet-lake ../../common/gpu/nvidia ../../common/gpu/nvidia/prime.nix ../../common/hidpi.nix diff --git a/lenovo/thinkpad/e470/default.nix b/lenovo/thinkpad/e470/default.nix index 3200732..55aa595 100644 --- a/lenovo/thinkpad/e470/default.nix +++ b/lenovo/thinkpad/e470/default.nix @@ -3,7 +3,7 @@ { imports = [ ../. - ../../../common/cpu/intel/kaby-lake + ../../../common/gpu/intel/kaby-lake ../../../common/gpu/nvidia/prime.nix ]; diff --git a/lenovo/thinkpad/l480/default.nix b/lenovo/thinkpad/l480/default.nix index d000320..2211c06 100644 --- a/lenovo/thinkpad/l480/default.nix +++ b/lenovo/thinkpad/l480/default.nix @@ -2,7 +2,7 @@ { imports = [ ../. - ../../../common/cpu/intel/kaby-lake + ../../../common/gpu/intel/kaby-lake ../../../common/pc/laptop/ssd ]; diff --git a/lenovo/thinkpad/p51/default.nix b/lenovo/thinkpad/p51/default.nix index 9128970..6bd162d 100644 --- a/lenovo/thinkpad/p51/default.nix +++ b/lenovo/thinkpad/p51/default.nix @@ -3,7 +3,7 @@ ../../../common/gpu/24.05-compat.nix ../../../common/gpu/nvidia/prime.nix ../../../common/cpu/intel - ../../../common/cpu/intel/kaby-lake + ../../../common/gpu/intel/kaby-lake ../../../common/pc/laptop/acpi_call.nix ../. ]; diff --git a/lenovo/thinkpad/t420/default.nix b/lenovo/thinkpad/t420/default.nix index a3c7db4..09f5d3f 100644 --- a/lenovo/thinkpad/t420/default.nix +++ b/lenovo/thinkpad/t420/default.nix @@ -2,7 +2,7 @@ imports = [ ../. ../tp-smapi.nix - ../../../common/cpu/intel/sandy-bridge + ../../../common/gpu/intel/sandy-bridge ../../../common/pc/laptop/acpi_call.nix ]; } diff --git a/lenovo/thinkpad/t520/default.nix b/lenovo/thinkpad/t520/default.nix index a3c7db4..09f5d3f 100644 --- a/lenovo/thinkpad/t520/default.nix +++ b/lenovo/thinkpad/t520/default.nix @@ -2,7 +2,7 @@ imports = [ ../. ../tp-smapi.nix - ../../../common/cpu/intel/sandy-bridge + ../../../common/gpu/intel/sandy-bridge ../../../common/pc/laptop/acpi_call.nix ]; } diff --git a/lenovo/thinkpad/w520/default.nix b/lenovo/thinkpad/w520/default.nix index a3c7db4..09f5d3f 100644 --- a/lenovo/thinkpad/w520/default.nix +++ b/lenovo/thinkpad/w520/default.nix @@ -2,7 +2,7 @@ imports = [ ../. ../tp-smapi.nix - ../../../common/cpu/intel/sandy-bridge + ../../../common/gpu/intel/sandy-bridge ../../../common/pc/laptop/acpi_call.nix ]; } diff --git a/lenovo/thinkpad/x220/default.nix b/lenovo/thinkpad/x220/default.nix index ec8b45c..c63333b 100644 --- a/lenovo/thinkpad/x220/default.nix +++ b/lenovo/thinkpad/x220/default.nix @@ -1,7 +1,7 @@ { imports = [ ../. - ../../../common/cpu/intel/sandy-bridge + ../../../common/gpu/intel/sandy-bridge ../../../common/pc/laptop/hdd # TODO: reverse compat ../tp-smapi.nix ]; diff --git a/microsoft/surface/surface-go/default.nix b/microsoft/surface/surface-go/default.nix index fdd13f6..017cd71 100644 --- a/microsoft/surface/surface-go/default.nix +++ b/microsoft/surface/surface-go/default.nix @@ -14,7 +14,7 @@ in { ../../../common/pc/ssd # The Intel CPU module auto-includes Intel's GPU: ../../../common/cpu/intel - ../../../common/cpu/intel/kaby-lake + ../../../common/gpu/intel/kaby-lake ]; boot.kernelParams = [ diff --git a/protectli/vp4670/default.nix b/protectli/vp4670/default.nix index fdaac85..14dcf4c 100644 --- a/protectli/vp4670/default.nix +++ b/protectli/vp4670/default.nix @@ -1,6 +1,6 @@ { imports = [ - ../../common/cpu/intel/comet-lake + ../../common/gpu/intel/comet-lake ]; boot.initrd.kernelModules = [ From a111ce6b537df12a39874aa9672caa87f8677eda Mon Sep 17 00:00:00 2001 From: Lyndon Sanche Date: Mon, 1 Jul 2024 15:40:59 -0600 Subject: [PATCH 85/88] flake: Deprecate Intel generation-specific outputs See #992 for more information. --- flake.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index 6072c4f..6c1a300 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,9 @@ description = "nixos-hardware"; outputs = _: { - nixosModules = { + nixosModules = let + deprecated = issue: name: value: builtins.trace "warning: ${name} flake output is deprecated and will be removed. See https://github.com/NixOS/nixos-hardware/issues/${issue} for more information" value; + in { acer-aspire-4810t = import ./acer/aspire/4810t; airis-n990 = import ./airis/n990; apple-macbook-air-3 = import ./apple/macbook-air/3; @@ -266,10 +268,10 @@ common-cpu-amd-zenpower = import ./common/cpu/amd/zenpower.nix; common-cpu-amd-raphael-igpu = import ./common/cpu/amd/raphael/igpu.nix; common-cpu-intel = import ./common/cpu/intel; - common-gpu-intel-comet-lake = import ./common/gpu/intel/comet-lake; + common-gpu-intel-comet-lake = deprecated "992" "common-gpu-intel-comet-lake" (import ./common/gpu/intel/comet-lake); common-cpu-intel-cpu-only = import ./common/cpu/intel/cpu-only.nix; - common-gpu-intel-kaby-lake = import ./common/gpu/intel/kaby-lake; - common-gpu-intel-sandy-bridge = import ./common/gpu/intel/sandy-bridge; + common-gpu-intel-kaby-lake = deprecated "992" "common-gpu-intel-kaby-lake" (import ./common/gpu/intel/kaby-lake); + common-gpu-intel-sandy-bridge = deprecated "992" "common-gpu-intel-sandy-bridge" (import ./common/gpu/intel/sandy-bridge); common-gpu-amd = import ./common/gpu/amd; common-gpu-amd-sea-islands = import ./common/gpu/amd/sea-islands; common-gpu-amd-southern-islands = import ./common/gpu/amd/southern-islands; From c5925d86de15f5939c5f0de2945fdc736b28d4b1 Mon Sep 17 00:00:00 2001 From: seth Date: Thu, 11 Jul 2024 15:24:30 -0400 Subject: [PATCH 86/88] common-gpu-nvidia: drop libva-vdpau-driver libva-vdpau-driver has not seen a new release in over a decade and is a common cause for bugs in some applications. NixOS has also been using the now preferred nvidia-vaapi-driver since https://github.com/NixOS/nixpkgs/pull/162660, so there isn't much reason to keep this --- common/gpu/nvidia/default.nix | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/common/gpu/nvidia/default.nix b/common/gpu/nvidia/default.nix index 01542ee..281e33f 100644 --- a/common/gpu/nvidia/default.nix +++ b/common/gpu/nvidia/default.nix @@ -1,13 +1,6 @@ -{ lib, pkgs, ... }: +{ lib, ... }: { imports = [ ../24.05-compat.nix ]; services.xserver.videoDrivers = lib.mkDefault [ "nvidia" ]; - hardware.graphics.extraPackages = [ - ( - if pkgs ? libva-vdpau-driver - then pkgs.libva-vdpau-driver - else pkgs.vaapiVdpau - ) - ]; } From 6b745e2331ba42e2f744434dcef1fe31ef9a4ced Mon Sep 17 00:00:00 2001 From: seth Date: Thu, 11 Jul 2024 15:43:10 -0400 Subject: [PATCH 87/88] common-gpu-nvidia: enable modesetting by default This is commonly required for many applications. As of https://github.com/NixOS/nixpkgs/pull/324921 this will also enable `nvidia-drm.fbdev=1`, fixing issues such as https://github.com/NixOS/nixpkgs/issues/302059 --- common/gpu/nvidia/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/gpu/nvidia/default.nix b/common/gpu/nvidia/default.nix index 281e33f..de1494e 100644 --- a/common/gpu/nvidia/default.nix +++ b/common/gpu/nvidia/default.nix @@ -3,4 +3,6 @@ { imports = [ ../24.05-compat.nix ]; services.xserver.videoDrivers = lib.mkDefault [ "nvidia" ]; + # TODO: this will be a default after https://github.com/NixOS/nixpkgs/pull/326369 + hardware.nvidia.modesetting.enable = true; } From c5013aa7ce2c7ec90acee5d965d950c8348db751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 12 Jul 2024 00:32:24 +0200 Subject: [PATCH 88/88] common/gpu/nvidia: use lib.mkDefault for hardware.nvidia.modesetting --- common/gpu/nvidia/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/gpu/nvidia/default.nix b/common/gpu/nvidia/default.nix index de1494e..df28c06 100644 --- a/common/gpu/nvidia/default.nix +++ b/common/gpu/nvidia/default.nix @@ -4,5 +4,5 @@ imports = [ ../24.05-compat.nix ]; services.xserver.videoDrivers = lib.mkDefault [ "nvidia" ]; # TODO: this will be a default after https://github.com/NixOS/nixpkgs/pull/326369 - hardware.nvidia.modesetting.enable = true; + hardware.nvidia.modesetting.enable = lib.mkDefault true; }