Compare commits

..

3 commits

Author SHA1 Message Date
Aires 704f05a3c8 Add Surface Pro 9 to Readme 2024-05-20 10:10:00 -04:00
Aires a1dc5cd106 Add Readme for Surface Pro 9 2024-05-12 12:00:44 -04:00
Aires 2e28b5160b Add Surface Pro 9 with Intel PSR disabled 2024-05-12 11:48:38 -04:00
28 changed files with 84 additions and 458 deletions

View file

@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@V27
- uses: cachix/install-nix-action@v26
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Show nixpkgs version

View file

@ -113,7 +113,6 @@ See code for all available configurations.
| [Dell Poweredge R7515](dell/poweredge/r7515) | `<nixos-hardware/dell/poweredge/r7515>` |
| [Dell Precision 3541](dell/precision/3541) | `<nixos-hardware/dell/precision/3541>` |
| [Dell Precision 5530](dell/precision/5530) | `<nixos-hardware/dell/precision/5530>` |
| [Dell Precision 7520](dell/precision/7520) | `<nixos-hardware/dell/precision/7520>` |
| [Dell XPS 13 7390](dell/xps/13-7390) | `<nixos-hardware/dell/xps/13-7390>` |
| [Dell XPS 13 9300](dell/xps/13-9300) | `<nixos-hardware/dell/xps/13-9300>` |
| [Dell XPS 13 9310](dell/xps/13-9310) | `<nixos-hardware/dell/xps/13-9310>` |
@ -179,7 +178,6 @@ See code for all available configurations.
| [Lenovo Legion 7 16achg6 (Nvidia)](lenovo/legion/16achg6/nvidia) | `<nixos-hardware/lenovo/legion/16achg6/nvidia>` |
| [Lenovo Legion 7i Pro 16irx8h (Intel)](lenovo/legion/16irx8h) | `<nixos-hardware/lenovo/legion/16irx8h>` |
| [Lenovo Legion Slim 7 Gen 7 (AMD)](lenovo/legion/16arha7/) | `<nixos-hardware/lenovo/legion/16arha7>` |
| [Lenovo Legion T5 AMR5](lenovo/legion/t526amr5) | `<nixos-hardware/lenovo/legion/t526amr5>` |
| [Lenovo Legion Y530 15ICH](lenovo/legion/15ich) | `<nixos-hardware/lenovo/legion/15ich>` |
| [Lenovo ThinkPad A475](lenovo/thinkpad/a475) | `<nixos-hardware/lenovo/thinkpad/a475>` |
| [Lenovo ThinkPad E14 (AMD)](lenovo/thinkpad/e14/amd) | `<nixos-hardware/lenovo/thinkpad/e14/amd>` |
@ -192,10 +190,7 @@ See code for all available configurations.
| [Lenovo ThinkPad L14 (Intel)](lenovo/thinkpad/l14/intel) | `<nixos-hardware/lenovo/thinkpad/l14/intel>` |
| [Lenovo ThinkPad L480](lenovo/thinkpad/l480) | `<nixos-hardware/lenovo/thinkpad/l480>` |
| [Lenovo ThinkPad P1 Gen 3](lenovo/thinkpad/p1/3th-gen) | `<nixos-hardware/lenovo/thinkpad/p1/3th-gen>` |
| [Lenovo ThinkPad P14s AMD Gen 1](lenovo/thinkpad/p14s/amd/gen1) | `<nixos-hardware/lenovo/thinkpad/p14s/amd/gen1>` |
| [Lenovo ThinkPad P14s AMD Gen 2](lenovo/thinkpad/p14s/amd/gen2) | `<nixos-hardware/lenovo/thinkpad/p14s/amd/gen2>` |
| [Lenovo ThinkPad P14s AMD Gen 3](lenovo/thinkpad/p14s/amd/gen3) | `<nixos-hardware/lenovo/thinkpad/p14s/amd/gen3>` |
| [Lenovo ThinkPad P14s AMD Gen 4](lenovo/thinkpad/p14s/amd/gen4) | `<nixos-hardware/lenovo/thinkpad/p14s/amd/gen4>` |
| [Lenovo ThinkPad P16s AMD Gen 1](lenovo/thinkpad/p16s/amd/gen1) | `<nixos-hardware/lenovo/thinkpad/p16s/amd/gen1>` |
| [Lenovo ThinkPad P1](lenovo/thinkpad/p1) | `<nixos-hardware/lenovo/thinkpad/p1>` |
| [Lenovo ThinkPad P50](lenovo/thinkpad/p50) | `<nixos-hardware/lenovo/thinkpad/p50>` |
@ -205,7 +200,6 @@ See code for all available configurations.
| [Lenovo ThinkPad T14 AMD Gen 1](lenovo/thinkpad/t14/amd/gen1) | `<nixos-hardware/lenovo/thinkpad/t14/amd/gen1>` |
| [Lenovo ThinkPad T14 AMD Gen 2](lenovo/thinkpad/t14/amd/gen2) | `<nixos-hardware/lenovo/thinkpad/t14/amd/gen2>` |
| [Lenovo ThinkPad T14 AMD Gen 3](lenovo/thinkpad/t14/amd/gen3) | `<nixos-hardware/lenovo/thinkpad/t14/amd/gen3>` |
| [Lenovo ThinkPad T14 AMD Gen 4](lenovo/thinkpad/t14/amd/gen4) | `<nixos-hardware/lenovo/thinkpad/t14/amd/gen4>` |
| [Lenovo ThinkPad T14](lenovo/thinkpad/t14) | `<nixos-hardware/lenovo/thinkpad/t14>` |
| [Lenovo ThinkPad T14s AMD Gen 1](lenovo/thinkpad/t14s/amd/gen1) | `<nixos-hardware/lenovo/thinkpad/t14s/amd/gen1>` |
| [Lenovo ThinkPad T14s](lenovo/thinkpad/t14s) | `<nixos-hardware/lenovo/thinkpad/t14s>` |
@ -267,12 +261,12 @@ See code for all available configurations.
| [Microsoft Surface Laptop (AMD)](microsoft/surface/surface-laptop-amd) | `<nixos-hardware/microsoft/surface/surface-laptop-amd>` |
| [Microsoft Surface Range (Common Modules)](microsoft/surface/common) | `<nixos-hardware/microsoft/surface/common>` |
| [Microsoft Surface Pro 3](microsoft/surface-pro/3) | `<nixos-hardware/microsoft/surface-pro/3>` |
| [Microsoft Surface Pro 9](microsoft/surface-pro/9) | `<nixos-hardware/microsoft/surface-pro/9>` |
| [Morefine M600](morefine/m600) | `<nixos-hardware/morefine/m600>` |
| [NXP iMX8 MPlus Evaluation Kit](nxp/imx8mp-evk) | `<nixos-hardware/nxp/imx8mp-evk>` |
| [NXP iMX8 MQuad Evaluation Kit](nxp/imx8mq-evk) | `<nixos-hardware/nxp/imx8mq-evk>` |
| [Hardkernel Odroid HC4](hardkernel/odroid-hc4/default.nix) | `<nixos-hardware/hardkernel/odroid-hc4>` |
| [Hardkernel Odroid H3](hardkernel/odroid-h3/default.nix) | `<nixos-hardware/hardkernel/odroid-h3>` |
| [Omen 15-en0010ca](omen/14-fb0798ng) | `<nixos-hardware/omen/14-fb0798ng>` |
| [Omen 15-en0010ca](omen/15-en0010ca) | `<nixos-hardware/omen/15-en0010ca>` |
| [Omen 16-n0005ne](omen/16-n0005ne) | `<nixos-hardware/omen/16-n0005ne>` |
| [Omen 15-en1007sa](omen/15-en1007sa) | `<nixos-hardware/omen/15-en1007sa>` |

View file

@ -5,11 +5,11 @@ let
patchRepo = fetchFromGitHub {
owner = "t2linux";
repo = "linux-t2-patches";
rev = "8b0e51ea87f170c559c9e2f437f85367838c2fad";
hash = "sha256-4YFaLW4WTKdFysIJHnshEaqoiKBFegnZiw4Kv88LjIA=";
rev = "7cd298e227e95bac9a704ffc8f5ff5e89a1bf4d7";
hash = "sha256-Oi3CwQl0IwdVc9w+pbmJjBnyqwLFhbqFwxs5o0mqtbE=";
};
version = "6.9";
version = "6.7.7";
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-j+Ufl6C1Mqjthk18GPt2e7j+i7viauOgNnVy9dJSgaM=";
}} $out
chmod -R u+w $out
cd $out

View file

@ -1,47 +1,21 @@
{ lib, pkgs, ... }:
{
lib,
pkgs,
config,
...
}: {
imports = [
../../common/cpu/amd
../../common/cpu/amd/raphael/igpu.nix
../../common/cpu/amd/pstate.nix
../../common/gpu/nvidia
../../common/gpu/nvidia/prime.nix
../../common/hidpi.nix
../../common/pc/laptop
../../common/pc/ssd
../battery.nix
];
imports = [
../../common/cpu/amd
../../common/cpu/amd/raphael/igpu.nix
../../common/cpu/amd/pstate.nix
../../common/gpu/nvidia
../../common/gpu/nvidia/prime-sync.nix
../../common/hidpi.nix
../../common/pc/laptop
../../common/pc/ssd
];
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.6") pkgs.linuxPackages_latest;
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.6") pkgs.linuxPackages_latest;
# The bottom 2 parts are taken from the framework 16-inch laptops configurations.
# Workaround for SuspendThenHibernate: https://lore.kernel.org/linux-kernel/20231106162310.85711-1-mario.limonciello@amd.com/
boot.kernelParams = lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8") ["rtc_cmos.use_acpi_alarm=1"];
# AMD has better battery life with PPD over TLP:
# https://community.frame.work/t/responded-amd-7040-sleep-states/38101/13
services.power-profiles-daemon.enable = lib.mkDefault true;
# Adds the missing asus functionality to Linux.
# https://asus-linux.org/manual/asusctl-manual/
services = {
asusd = {
enable = lib.mkDefault true;
enableUserService = lib.mkDefault true;
};
};
hardware.nvidia = {
modesetting.enable = lib.mkDefault true;
open = lib.mkDefault false;
nvidiaSettings = lib.mkDefault true;
prime = {
hardware.nvidia.prime = {
amdgpuBusId = "PCI:54:0:0";
nvidiaBusId = "PCI:1:0:0";
};
};
}
}

View file

@ -1,10 +0,0 @@
{ lib, config, ... }:
{
# Enables the zenpower sensor in lieu of the k10temp sensor on Zen CPUs https://git.exozy.me/a/zenpower3
# On Zen CPUs zenpower produces much more data entries
imports = [ ./. ];
boot.blacklistedKernelModules = [ "k10temp" ];
boot.extraModulePackages = [ config.boot.kernelPackages.zenpower ];
boot.kernelModules = [ "zenpower" ];
}

View file

@ -21,12 +21,6 @@
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
];
}
];
}

View file

@ -1,67 +0,0 @@
# Dell Precision 7520
This configuration opts to use the non-free nvidia driver, as UI glitching was often observed with `nouveau` when using
a compositor.
## Device Details
- Dell Precision 7520 (07B0)
- Intel Core i7-7820HQ CPU (Kaby Lake)
- 32GB RAM
- SK hynix SC311 SATA 1TB
- Intel HD Graphics 630 (Coffee Lake)
- NVIDIA GM206GLM [Quadro M2200 Mobile]
## Tested Hardware
```bash
lspci -nn
00:00.0 Host bridge [0600]: Intel Corporation Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers [8086:5910] (rev 05)
00:01.0 PCI bridge [0604]: Intel Corporation 6th-10th Gen Core Processor PCIe Controller (x16) [8086:1901] (rev 05)
00:02.0 VGA compatible controller [0300]: Intel Corporation HD Graphics 630 [8086:591b] (rev 04)
00:04.0 Signal processing controller [1180]: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem [8086:1903] (rev 05)
00:14.0 USB controller [0c03]: Intel Corporation 100 Series/C230 Series Chipset Family USB 3.0 xHCI Controller [8086:a12f] (rev 31)
00:14.2 Signal processing controller [1180]: Intel Corporation 100 Series/C230 Series Chipset Family Thermal Subsystem [8086:a131] (rev 31)
00:15.0 Signal processing controller [1180]: Intel Corporation 100 Series/C230 Series Chipset Family Serial IO I2C Controller #0 [8086:a160] (rev 31)
00:15.1 Signal processing controller [1180]: Intel Corporation 100 Series/C230 Series Chipset Family Serial IO I2C Controller #1 [8086:a161] (rev 31)
00:16.0 Communication controller [0780]: Intel Corporation 100 Series/C230 Series Chipset Family MEI Controller #1 [8086:a13a] (rev 31)
00:17.0 RAID bus controller [0104]: Intel Corporation SATA Controller [RAID mode] [8086:2822] (rev 31)
00:1c.0 PCI bridge [0604]: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #2 [8086:a111] (rev f1)
00:1c.2 PCI bridge [0604]: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #3 [8086:a112] (rev f1)
00:1c.4 PCI bridge [0604]: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #5 [8086:a114] (rev f1)
00:1f.0 ISA bridge [0601]: Intel Corporation CM238 Chipset LPC/eSPI Controller [8086:a154] (rev 31)
00:1f.2 Memory controller [0580]: Intel Corporation 100 Series/C230 Series Chipset Family Power Management Controller [8086:a121] (rev 31)
00:1f.3 Audio device [0403]: Intel Corporation CM238 HD Audio Controller [8086:a171] (rev 31)
00:1f.4 SMBus [0c05]: Intel Corporation 100 Series/C230 Series Chipset Family SMBus [8086:a123] (rev 31)
00:1f.6 Ethernet controller [0200]: Intel Corporation Ethernet Connection (5) I219-LM [8086:15e3] (rev 31)
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GM206GLM [Quadro M2200 Mobile] [10de:1436] (rev a1)
01:00.1 Audio device [0403]: NVIDIA Corporation GM206 High Definition Audio Controller [10de:0fba] (rev a1)
02:00.0 Network controller [0280]: Intel Corporation Wireless 8265 / 8275 [8086:24fd] (rev 78)
03:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS525A PCI Express Card Reader [10ec:525a] (rev 01)
04:00.0 PCI bridge [0604]: Intel Corporation JHL6340 Thunderbolt 3 Bridge (C step) [Alpine Ridge 2C 2016] [8086:15da] (rev 02)
05:00.0 PCI bridge [0604]: Intel Corporation JHL6340 Thunderbolt 3 Bridge (C step) [Alpine Ridge 2C 2016] [8086:15da] (rev 02)
05:01.0 PCI bridge [0604]: Intel Corporation JHL6340 Thunderbolt 3 Bridge (C step) [Alpine Ridge 2C 2016] [8086:15da] (rev 02)
05:02.0 PCI bridge [0604]: Intel Corporation JHL6340 Thunderbolt 3 Bridge (C step) [Alpine Ridge 2C 2016] [8086:15da] (rev 02)
3c:00.0 USB controller [0c03]: Intel Corporation JHL6340 Thunderbolt 3 USB 3.1 Controller (C step) [Alpine Ridge 2C 2016] [8086:15db] (rev 02)
```
## Doesn't work
- External monitor for luks passphrase entry
## Firmware Upgrades
Note that this device is supported by fwupd. To perform firmware upgrades just activate the service:
```nix
services.fwupd.enable = true;
```
Then use `fwupdmgr` to perform updates
## Nvidia Driver
The choice of the `legacy_390` driver is based on looking for PCI Device ID `10de:1436`. On the [nvidia driver site](https://www.nvidia.com/en-us/drivers/unix/legacy-gpu/) which should indicate the
driver, the exact device isn't listed. However, we can see
[here](https://linux-hardware.org/?id=pci:10de-1436-103c-1909) has nvidia driver "375.82 and newer" listed. Since the
newest nvidia drivers don't support legacy devices, the closest version newer than 375.82 was chosen.

View file

@ -1,50 +0,0 @@
{
config,
lib,
pkgs,
inputs,
...
}: {
imports = [
../../../common/cpu/intel/kaby-lake
../../../common/pc/laptop
../../../common/pc/laptop/ssd
../../../common/gpu/nvidia
];
hardware.enableRedistributableFirmware = lib.mkDefault true;
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc"];
boot = {
kernelModules = ["kvm-intel"];
blacklistedKernelModules = ["nouveau"];
};
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.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");
};
services.thermald.enable = lib.mkDefault true;
# available cpufreq governors: performance powersave
# The powersave mode locks the cpu to a 900mhz frequency which is not ideal
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
}

View file

@ -47,7 +47,6 @@
dell-poweredge-r7515 = import ./dell/poweredge/r7515;
dell-precision-3541 = import ./dell/precision/3541;
dell-precision-5530 = import ./dell/precision/5530;
dell-precision-7520 = import ./dell/precision/7520;
dell-xps-13-7390 = import ./dell/xps/13-7390;
dell-xps-13-9300 = import ./dell/xps/13-9300;
dell-xps-13-9310 = import ./dell/xps/13-9310;
@ -70,7 +69,6 @@
dell-xps-15-9560 = import ./dell/xps/15-9560;
dell-xps-15-9560-intel = import ./dell/xps/15-9560/intel;
dell-xps-15-9560-nvidia = import ./dell/xps/15-9560/nvidia;
dell-xps-15-9570 = import ./dell/xps/15-9570;
dell-xps-15-9570-intel = import ./dell/xps/15-9570/intel;
dell-xps-15-9570-nvidia = import ./dell/xps/15-9570/nvidia;
dell-xps-17-9700-intel = import ./dell/xps/17-9700/intel;
@ -113,7 +111,6 @@
lenovo-legion-16arha7 = import ./lenovo/legion/16arha7;
lenovo-legion-16ithg6 = import ./lenovo/legion/16ithg6;
lenovo-legion-16irx8h = import ./lenovo/legion/16irx8h;
lenovo-legion-t526amr5 = import ./lenovo/legion/t526amr5;
lenovo-legion-y530-15ich = import ./lenovo/legion/15ich;
lenovo-thinkpad = import ./lenovo/thinkpad;
lenovo-thinkpad-a475 = import ./lenovo/thinkpad/a475;
@ -128,10 +125,7 @@
lenovo-thinkpad-l480 = import ./lenovo/thinkpad/l480;
lenovo-thinkpad-p1 = import ./lenovo/thinkpad/p1;
lenovo-thinkpad-p1-gen3 = import ./lenovo/thinkpad/p1/3th-gen;
lenovo-thinkpad-p14s-amd-gen1 = import ./lenovo/thinkpad/p14s/amd/gen1;
lenovo-thinkpad-p14s-amd-gen2 = import ./lenovo/thinkpad/p14s/amd/gen2;
lenovo-thinkpad-p14s-amd-gen3 = import ./lenovo/thinkpad/p14s/amd/gen3;
lenovo-thinkpad-p14s-amd-gen4 = import ./lenovo/thinkpad/p14s/amd/gen4;
lenovo-thinkpad-p16s-amd-gen1 = import ./lenovo/thinkpad/p16s/amd/gen1;
lenovo-thinkpad-p50 = import ./lenovo/thinkpad/p50;
lenovo-thinkpad-p51 = import ./lenovo/thinkpad/p51;
@ -141,7 +135,6 @@
lenovo-thinkpad-t14-amd-gen1 = import ./lenovo/thinkpad/t14/amd/gen1;
lenovo-thinkpad-t14-amd-gen2 = import ./lenovo/thinkpad/t14/amd/gen2;
lenovo-thinkpad-t14-amd-gen3 = import ./lenovo/thinkpad/t14/amd/gen3;
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-t410 = import ./lenovo/thinkpad/t410;
@ -201,6 +194,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;
@ -212,7 +206,6 @@
nxp-imx8qm-mek = import ./nxp/imx8qm-mek;
hardkernel-odroid-hc4 = import ./hardkernel/odroid-hc4;
hardkernel-odroid-h3 = import ./hardkernel/odroid-h3;
omen-14-fb0798ng = import ./omen/14-fb0798ng;
omen-15-en0010ca = import ./omen/15-en0010ca;
omen-16-n0005ne = import ./omen/16-n0005ne;
omen-15-en1007sa = import ./omen/15-en1007sa;
@ -249,7 +242,6 @@
common-cpu-amd = import ./common/cpu/amd;
common-cpu-amd-pstate = import ./common/cpu/amd/pstate.nix;
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;

View file

@ -1,6 +1,6 @@
## Introduction
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.
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!!
## Setup at the time of testing
```

View file

@ -1,4 +1,4 @@
{ config, pkgs, lib, ... }:
{ config, pkgs, ... }:
let
lenovo-speaker-fix = pkgs.callPackage ./audio/lenovo-16ARHA7_speaker-fix.nix {
@ -14,8 +14,7 @@ in
../../../common/pc/laptop/ssd
];
# 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 ];
boot.extraModulePackages = [ lenovo-speaker-fix ];
# √(2560² + 1600²) px / 16 in ≃ 189 dpi
services.xserver.dpi = 189;

View file

@ -1,12 +0,0 @@
{ lib, ... }:
{
imports = [
../../../common/cpu/amd
../../../common/gpu/nvidia
../../../common/pc/ssd
];
# TPM2 module
security.tpm2.enable = true;
}

View file

@ -1,12 +0,0 @@
{ lib, pkgs, ... }:
{
imports = [
../.
../../../../common/cpu/amd
../../../../common/gpu/amd
];
# For support of newer AMD GPUs, backlight and internal microphone
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.8") pkgs.linuxPackages_latest;
}

View file

@ -1,5 +0,0 @@
{
imports = [
../.
];
}

View file

@ -1,8 +1,9 @@
{ lib, pkgs, config, ... }:
{
imports = [
../.
../../../../../common/cpu/amd/pstate.nix
../../../../../common/pc/laptop/acpi_call.nix
../../../../../common/cpu/amd
../../../../../common/gpu/amd
];
# For suspending to RAM, set Config -> Power -> Sleep State to "Linux" in EFI.

View file

@ -1,12 +0,0 @@
{ lib, pkgs, ... }:
{
imports = [
../.
../../../../../common/cpu/amd/pstate.nix
];
# For the Qualcomm NFA-725A (Device 1103) wireless network controller
# See https://bugzilla.redhat.com/show_bug.cgi?id=2047878
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.16") pkgs.linuxPackages_latest;
}

View file

@ -1,11 +0,0 @@
{ lib, pkgs, config, ... }:
{
imports = [
../.
../../../../../common/cpu/amd/pstate.nix
];
# For the Qualcomm NFA765 [17cb:1103] wireless network controller
# See https://bugzilla.redhat.com/show_bug.cgi?id=2047878
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.16") pkgs.linuxPackages_latest;
}

View file

@ -1,22 +0,0 @@
{ lib, pkgs, ... }:
{
# P14s is a rebadged T14 with slight internal differences.
# This may change for future models, so we duplicate the T14 hierarchy here.
imports = [
../.
../../../common/pc/laptop/acpi_call.nix
../../../common/pc/laptop/ssd
];
# Force use of the amdgpu driver for backlight control on kernel versions where the
# native backlight driver is not already preferred. This is preferred over the
# "vendor" setting, in this case the thinkpad_acpi driver.
# See https://hansdegoede.livejournal.com/27130.html
# See https://lore.kernel.org/linux-acpi/20221105145258.12700-1-hdegoede@redhat.com/
boot.kernelParams = lib.mkIf (lib.versionOlder pkgs.linux.version "6.2") [ "acpi_backlight=native" ];
# see https://github.com/NixOS/nixpkgs/issues/69289
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.2") pkgs.linuxPackages_latest;
}

View file

@ -3,7 +3,6 @@
{
imports = [
../.
../../../../../common/cpu/amd/pstate.nix
];
# For support of MEDIATEK Corp. Device 7961 wireless network controller, see https://lwn.net/Articles/843303/

View file

@ -3,7 +3,6 @@
{
imports = [
../.
../../../../../common/cpu/amd/pstate.nix
];
# For the Qualcomm NFA-725A (Device 1103) wireless network controller

View file

@ -1,12 +0,0 @@
{ lib, pkgs, config, ... }:
{
imports = [
../.
../../../../../common/cpu/amd/pstate.nix
];
# For the Qualcomm NFA765 [17cb:1103] wireless network controller
# See https://bugzilla.redhat.com/show_bug.cgi?id=2047878
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.16") pkgs.linuxPackages_latest;
}

View file

@ -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`.

View file

@ -0,0 +1,5 @@
{
imports = [ ../../surface/surface-pro-intel ];
boot.kernelParams = [ "i915.enable_psr=0" ]; # Disable Intel Panel Self Refresh
}

View file

@ -1,57 +1,19 @@
{ stdenv
, lib
, bison
, dtc
, fetchgit
, flex
, gnutls
, libuuid
, ncurses
, openssl
, which
, perl
, buildPackages
}:
let
ubsrc = fetchgit {
{pkgs}:
with pkgs; let
inherit buildUBoot;
in
(buildUBoot {
pname = "imx8mp-uboot";
version = "2023.04";
src = fetchgit {
url = "https://github.com/nxp-imx/uboot-imx.git";
# tag: "lf-6.1.55-2.2.0"
rev = "49b102d98881fc28af6e0a8af5ea2186c1d90a5f";
sha256 = "sha256-1j6X82DqezEizeWoSS600XKPNwrQ4yT0vZuUImKAVVA=";
};
in
(stdenv.mkDerivation {
pname = "imx8mp-uboot";
version = "2023.04";
src = ubsrc;
postPatch = ''
patchShebangs tools
patchShebangs scripts
'';
nativeBuildInputs = [
bison
flex
openssl
which
ncurses
libuuid
gnutls
openssl
perl
];
depsBuildBuild = [ buildPackages.stdenv.cc ];
hardeningDisable = [ "all" ];
enableParallelBuilding = true;
makeFlags = [
"DTC=${lib.getExe buildPackages.dtc}"
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
];
extraConfig = ''
extraConfig = ''
CONFIG_USE_BOOTCOMMAND=y
CONFIG_BOOTCOMMAND="setenv ramdisk_addr_r 0x45000000; setenv fdt_addr_r 0x44000000; run distro_bootcmd; "
CONFIG_CMD_BOOTEFI_SELFTEST=y
@ -63,28 +25,17 @@ in
CONFIG_CMD_CACHE=y
'';
passAsFile = [ "extraConfig" ];
enableParallelBuilding = true;
defconfig = "imx8mp_evk_defconfig";
extraMeta.platforms = ["aarch64-linux"];
configurePhase = ''
runHook preConfigure
make imx8mp_evk_defconfig
cat $extraConfigPath >> .config
runHook postConfigure
'';
installPhase = ''
runHook preInstall
mkdir -p $out
cp ./u-boot-nodtb.bin $out
cp ./spl/u-boot-spl.bin $out
cp ./arch/arm/dts/imx8mp-evk.dtb $out
cp .config $out
runHook postInstall
'';
dontStrip = true;
filesToInstall = [
"./u-boot-nodtb.bin"
"./spl/u-boot-spl.bin"
"./arch/arm/dts/imx8mp-evk.dtb"
".config"
];
})
.overrideAttrs (old: {
nativeBuildInputs = old.nativeBuildInputs ++ [pkgs.perl];
})

View file

@ -1,57 +1,19 @@
{ stdenv
, lib
, bison
, dtc
, fetchgit
, flex
, gnutls
, libuuid
, ncurses
, openssl
, which
, perl
, buildPackages
}:
let
ubsrc = fetchgit {
{pkgs}:
with pkgs; let
inherit buildUBoot;
in
(buildUBoot {
pname = "imx8mq-uboot";
version = "2023.04";
src = fetchgit {
url = "https://github.com/nxp-imx/uboot-imx.git";
# tag: "lf-6.1.55-2.2.0"
rev = "49b102d98881fc28af6e0a8af5ea2186c1d90a5f";
sha256 = "sha256-1j6X82DqezEizeWoSS600XKPNwrQ4yT0vZuUImKAVVA=";
};
in
(stdenv.mkDerivation {
pname = "imx8mq-uboot";
version = "2023.04";
src = ubsrc;
postPatch = ''
patchShebangs tools
patchShebangs scripts
'';
nativeBuildInputs = [
bison
flex
openssl
which
ncurses
libuuid
gnutls
openssl
perl
];
depsBuildBuild = [ buildPackages.stdenv.cc ];
hardeningDisable = [ "all" ];
enableParallelBuilding = true;
makeFlags = [
"DTC=${lib.getExe buildPackages.dtc}"
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
];
extraConfig = ''
extraConfig = ''
CONFIG_USE_BOOTCOMMAND=y
CONFIG_BOOTCOMMAND="setenv ramdisk_addr_r 0x45000000; setenv fdt_addr_r 0x44000000; run distro_bootcmd; "
CONFIG_CMD_BOOTEFI_SELFTEST=y
@ -63,28 +25,17 @@ in
CONFIG_CMD_CACHE=y
'';
passAsFile = [ "extraConfig" ];
enableParallelBuilding = true;
defconfig = "imx8mq_evk_defconfig";
extraMeta.platforms = ["aarch64-linux"];
configurePhase = ''
runHook preConfigure
make imx8mq_evk_defconfig
cat $extraConfigPath >> .config
runHook postConfigure
'';
installPhase = ''
runHook preInstall
mkdir -p $out
cp ./u-boot-nodtb.bin $out
cp ./spl/u-boot-spl.bin $out
cp ./arch/arm/dts/imx8mq-evk.dtb $out
cp .config $out
runHook postInstall
'';
dontStrip = true;
filesToInstall = [
"./u-boot-nodtb.bin"
"./spl/u-boot-spl.bin"
"./arch/arm/dts/imx8mq-evk.dtb"
".config"
];
})
.overrideAttrs (old: {
nativeBuildInputs = old.nativeBuildInputs ++ [pkgs.perl];
})

View file

@ -1,4 +0,0 @@
# HP Omen 14-fb0798ng
## ACPI platform profiles
This config enables `hp-wmi`, which allows switch between cool, balanced, and performance modes on the platform EC, used by power management tools like `power-profile-daemon` and `tlp`.

View file

@ -1,23 +0,0 @@
{ lib, pkgs, ... }:
{
imports = [
../../common/cpu/intel
../../common/gpu/nvidia/prime.nix
../../common/pc/laptop
../../common/pc/ssd
];
# Enables ACPI platform profiles
boot = lib.mkIf (lib.versionAtLeast pkgs.linux.version "6.1") {
kernelModules = [ "hp-wmi" ];
};
# Enables Wifi and Bluetooth
hardware.enableRedistributableFirmware = true;
hardware.nvidia.prime = {
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
}