Compare commits

..
1 Commits
Author SHA1 Message Date
Jörg Thalheim e60c66bd0b replace tlp with power-profiles-daemon
TLP is often no longer the best choice since firmware provides power
profiles instead. That's why we are removing TLP as the default option.
We may want to bring back TLP to some old hardware if it makes sense
i.e. certain thinkpad modules.
2025-11-06 12:07:59 +01:00
58 changed files with 156 additions and 1006 deletions

No files matched your search

+2 -2
View File
@@ -9,13 +9,13 @@ jobs:
nixfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v5
- uses: cachix/install-nix-action@v31
- run: nix build .#checks.x86_64-linux.formatting
tests:
needs: nixfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v5
- uses: cachix/install-nix-action@v31
- run: nix run .#run-tests
+3 -2
View File
@@ -14,8 +14,9 @@ For example:
```nix
{ lib }: {
# Using mkDefault, because the user might want to disable tlp
services.tlp.enable = lib.mkDefault true;
# Using mkDefault, because the user might want to disable power-profiles-daemon
services.power-profiles-daemon.enable = lib.mkDefault true;
# No need to use mkDefault, because the setting will merge with the user's setting
boot.kernelModules = [ "tmp_smapi" ];
}
+1 -7
View File
@@ -109,7 +109,6 @@ See code for all available configurations.
| [Asus ROG Ally RC71L (2023)](asus/ally/rc71l) | `<nixos-hardware/asus/ally/rc71l>` | `asus-ally-rc71l` |
| [Asus ROG Flow X13 GV302X\* (2023)](asus/flow/gv302x/amdgpu) | `<nixos-hardware/asus/flow/gv302x/amdgpu>` | `asus-flow-gv302x-amdgpu` |
| [Asus ROG Flow X13 GV302X\* (2023)](asus/flow/gv302x/nvidia) | `<nixos-hardware/asus/flow/gv302x/nvidia>` | `asus-flow-gv302x-nvidia` |
| [Asus ROG Flow Z13 gz301vu\* (2023)](asus/flow/gz301vu) | `<nixos-hardware/asus/flow/gz301vu>` | `asus-flow-gz301vu` |
| [Asus ROG GL552VW](asus/rog-gl552vw) | `<nixos-hardware/asus/rog-gl552vw>` | `asus-rog-gl552vw` |
| [Asus ROG Strix G513IM](asus/rog-strix/g513im) | `<nixos-hardware/asus/rog-strix/g513im>` | `asus-rog-strix-g513im` |
| [Asus ROG Strix G533ZW](asus/rog-strix/g533zw) | `<nixos-hardware/asus/rog-strix/g533zw>` | `asus-rog-strix-g533zw` |
@@ -117,8 +116,7 @@ See code for all available configurations.
| [Asus ROG Strix G713IE](asus/rog-strix/g713ie) | `<nixos-hardware/asus/rog-strix/g713ie>` | `asus-rog-strix-g713ie` |
| [Asus ROG Strix G733QS](asus/rog-strix/g733qs) | `<nixos-hardware/asus/rog-strix/g733qs>` | `asus-rog-strix-g733qs` |
| [Asus ROG Strix X570-E GAMING](asus/rog-strix/x570e) | `<nixos-hardware/asus/rog-strix/x570e>` | `asus-rog-strix-x570e` |
| [Asus ROG Zephyrus G14 GA401IV (2020)](asus/zephyrus/ga401iv) | `<nixos-hardware/asus/zephyrus/ga401iv>` | `asus-zephyrus-ga401iv` |
| [Asus ROG Zephyrus G14 GA401 (2021)](asus/zephyrus/ga401) | `<nixos-hardware/asus/zephyrus/ga401>` | `asus-zephyrus-ga401` |
| [Asus ROG Zephyrus G14 GA401](asus/zephyrus/ga401) | `<nixos-hardware/asus/zephyrus/ga401>` | `asus-zephyrus-ga401` |
| [Asus ROG Zephyrus G14 GA402](asus/zephyrus/ga402) | `<nixos-hardware/asus/zephyrus/ga402>` | `asus-zephyrus-ga402` |
| [Asus ROG Zephyrus G14 GA402X\* (2023)](asus/zephyrus/ga402x/amdgpu) | `<nixos-hardware/asus/zephyrus/ga402x/amdgpu>` | `asus-zephyrus-ga402x-amdgpu` |
| [Asus ROG Zephyrus G14 GA402X\* (2023)](asus/zephyrus/ga402x/nvidia) | `<nixos-hardware/asus/zephyrus/ga402x/nvidia>` | `asus-zephyrus-ga402x-nvidia` |
@@ -136,7 +134,6 @@ See code for all available configurations.
| [Asus Zenbook Flip S13 UX371](asus/zenbook/ux371/) | `<nixos-hardware/asus/zenbook/ux371>` | `asus-zenbook-ux371` |
| [Asus Zenbook Pro 15 UX535](asus/zenbook/ux535/) | `<nixos-hardware/asus/zenbook/ux535>` | `asus-zenbook-ux535` |
| [Asus Zenbook Pro 17 UM6702](asus/zenbook/um6702/) | `<nixos-hardware/asus/zenbook/um6702>` | `asus-zenbook-um6702` |
| [Asrock Rack ALTRAD8UD-1L2T](asrock-rack/altrad8ud-1l2t) | `<nixos-hardware/asrock-rack/altrad8ud-1l2t>` | `asrock-rack-altrad8ud-1l2t` |
| [BeagleBoard PocketBeagle](beagleboard/pocketbeagle) | `<nixos-hardware/beagleboard/pocketbeagle>` | `beagleboard-pocketbeagle` |
| [Chuwi MiniBook X](chuwi/minibook-x) | `<nixos-hardware/chuwi/minibook-x>` | `chuwi-minibook-x` |
| [Deciso DEC series](deciso/dec) | `<nixos-hardware/deciso/dec>` | `deciso-dec` |
@@ -266,7 +263,6 @@ See code for all available configurations.
| [Lenovo Legion 7 16achg6 (Nvidia)](lenovo/legion/16achg6/nvidia) | `<nixos-hardware/lenovo/legion/16achg6/nvidia>` | `lenovo-legion-16achg6-nvidia` |
| [Lenovo Legion 7i Pro 16irx8h (Intel)](lenovo/legion/16irx8h) | `<nixos-hardware/lenovo/legion/16irx8h>` | `lenovo-legion-16irx8h` |
| [Lenovo Legion 7 Pro 16irx9h (Intel)](lenovo/legion/16irx9h) | `<nixos-hardware/lenovo/legion/16irx9h>` | `lenovo-legion-16irx9h` |
| [Lenovo Legion Pro 7 16iax10h (Intel)](lenovo/legion/16iax10h) | `<nixos-hardware/lenovo/legion/16iax10h>` | `lenovo-legion-16iax10h` |
| [Lenovo Legion Slim 5](lenovo/legion/16aph8/) | `<nixos-hardware/lenovo/legion/16aph8>` | `lenovo-legion-16aph8` |
| [Lenovo Legion Slim 7 Gen 7 (AMD)](lenovo/legion/16arha7/) | `<nixos-hardware/lenovo/legion/16arha7>` | `lenovo-legion-16arha7` |
| [Lenovo Legion T5 AMR5](lenovo/legion/t526amr5) | `<nixos-hardware/lenovo/legion/t526amr5>` | `lenovo-legion-t526amr5` |
@@ -275,7 +271,6 @@ See code for all available configurations.
| [Lenovo ThinkPad E14 (AMD)](lenovo/thinkpad/e14/amd) | `<nixos-hardware/lenovo/thinkpad/e14/amd>` | `lenovo-thinkpad-e14-amd` |
| [Lenovo ThinkPad E14 (Intel - Gen 1)](lenovo/thinkpad/e14/intel) | `<nixos-hardware/lenovo/thinkpad/e14/intel>` | `lenovo-thinkpad-e14-intel` |
| [Lenovo ThinkPad E14 (Intel - Gen 4)](lenovo/thinkpad/e14/intel/gen4) | `<nixos-hardware/lenovo/thinkpad/e14/intel/gen4>` | `lenovo-thinkpad-e14-intel-gen4` |
| [Lenovo ThinkPad E14 (Intel - Gen 2)](lenovo/thinkpad/e14/intel/gen2) | `<nixos-hardware/lenovo/thinkpad/e14/intel/gen2>` | `lenovo-thinkpad-e14-intel-gen2` |
| [Lenovo ThinkPad E14 (Intel - Gen 6)](lenovo/thinkpad/e14/intel/gen6) | `<nixos-hardware/lenovo/thinkpad/e14/intel/gen6>` | `lenovo-thinkpad-e14-intel-gen6` |
| [Lenovo ThinkPad E15 (Intel)](lenovo/thinkpad/e15/intel) | `<nixos-hardware/lenovo/thinkpad/e15/intel>` | `lenovo-thinkpad-e15-intel` |
| [Lenovo ThinkPad E470](lenovo/thinkpad/e470) | `<nixos-hardware/lenovo/thinkpad/e470>` | `lenovo-thinkpad-e470` |
@@ -423,7 +418,6 @@ See code for all available configurations.
| [Radxa ROCK 5 Model B](radxa/rock-5b) | `<nixos-hardware/radxa/rock-5b>` | `rock-5b` |
| [Radxa ROCK Pi 4](radxa/rock-pi-4) | `<nixos-hardware/radxa/rock-pi-4>` | `rock-pi-4` |
| [Radxa ROCK Pi E](radxa/rock-pi-e) | `<nixos-hardware/radxa/rock-pi-e>` | `rock-pi-e` |
| [Razer Blade 14 (RZ09-0530)](razer/blade/14/RZ09-0530) | `<nixos-hardware/razer/blade/14/RZ09-0530>` | `razer-blade-14-RZ09-0530` |
| [Raspberry Pi 2](raspberry-pi/2) | `<nixos-hardware/raspberry-pi/2>` | `raspberry-pi-2` |
| [Raspberry Pi 3](raspberry-pi/3) | `<nixos-hardware/raspberry-pi/3>` | `raspberry-pi-3` |
| [Raspberry Pi 4](raspberry-pi/4) | `<nixos-hardware/raspberry-pi/4>` | `raspberry-pi-4` |
-44
View File
@@ -1,44 +0,0 @@
# ASRock Rack ALTRAD8UD-1L2T
This is a popular motherboard for the [Ampere Altra](https://amperecomputing.com/briefs/ampere-altra-family-product-brief) family of CPUs.
It is used in for example the [System76 Thelio Astra](https://system76.com/desktops/thelio-astra-a1.1-n1/configure)
```shellsession
$ pciutils -nn
0000:00:00.0 Host bridge [0600]: Ampere Computing, LLC Altra PCI Express Root Complex A [1def:e100]
0000:00:01.0 PCI bridge [0604]: Ampere Computing, LLC Altra PCI Express Root Port a0 [1def:e101] (rev 04)
0001:00:00.0 Host bridge [0600]: Ampere Computing, LLC Altra PCI Express Root Complex A [1def:e100]
0001:00:01.0 PCI bridge [0604]: Ampere Computing, LLC Altra PCI Express Root Port a0 [1def:e101] (rev 04)
0002:00:00.0 Host bridge [0600]: Ampere Computing, LLC Altra PCI Express Root Complex A [1def:e100]
0002:00:01.0 PCI bridge [0604]: Ampere Computing, LLC Altra PCI Express Root Port a0 [1def:e101] (rev 04)
0002:00:02.0 PCI bridge [0604]: Ampere Computing, LLC Altra PCI Express Root Port a1 [1def:e102] (rev 04)
0002:00:03.0 PCI bridge [0604]: Ampere Computing, LLC Altra PCI Express Root Port a2 [1def:e103] (rev 04)
0002:00:04.0 PCI bridge [0604]: Ampere Computing, LLC Altra PCI Express Root Port a3 [1def:e104] (rev 04)
0002:01:00.0 Non-Volatile memory controller [0108]: Sandisk Corp WD Black SN850X NVMe SSD [15b7:5030] (rev 01)
0003:00:00.0 Host bridge [0600]: Ampere Computing, LLC Altra PCI Express Root Complex A [1def:e100]
0003:00:01.0 PCI bridge [0604]: Ampere Computing, LLC Altra PCI Express Root Port a0 [1def:e101] (rev 04)
0003:00:02.0 PCI bridge [0604]: Ampere Computing, LLC Altra PCI Express Root Port a1 [1def:e102] (rev 04)
0003:00:03.0 PCI bridge [0604]: Ampere Computing, LLC Altra PCI Express Root Port a2 [1def:e103] (rev 04)
0003:00:04.0 PCI bridge [0604]: Ampere Computing, LLC Altra PCI Express Root Port a3 [1def:e104] (rev 04)
0003:01:00.0 PCI bridge [0604]: ASRock Incorporation Device [1849:1150] (rev 04)
0003:02:00.0 VGA compatible controller [0300]: ASPEED Technology, Inc. ASPEED Graphics Family [1a03:2000] (rev 41)
0003:03:00.0 Ethernet controller [0200]: Intel Corporation Ethernet Controller X550 [8086:1563] (rev 01)
0003:03:00.1 Ethernet controller [0200]: Intel Corporation Ethernet Controller X550 [8086:1563] (rev 01)
0003:04:00.0 USB controller [0c03]: ASMedia Technology Inc. ASM3042 USB 3.2 Gen 1 xHCI Controller [1b21:3042]
0003:05:00.0 Ethernet controller [0200]: Intel Corporation I210 Gigabit Network Connection [8086:1533] (rev 03)
0004:00:00.0 Host bridge [0600]: Ampere Computing, LLC Altra PCI Express Root Complex A [1def:e100]
0004:00:01.0 PCI bridge [0604]: Ampere Computing, LLC Altra PCI Express Root Port a0 [1def:e101] (rev 04)
0005:00:00.0 Host bridge [0600]: Ampere Computing, LLC Altra PCI Express Root Complex A [1def:e100]
0005:00:01.0 PCI bridge [0604]: Ampere Computing, LLC Altra PCI Express Root Port a0 [1def:e101] (rev 04)
000c:00:00.0 Host bridge [0600]: Ampere Computing, LLC Altra PCI Express Root Complex A [1def:e100]
000c:00:01.0 PCI bridge [0604]: Ampere Computing, LLC Altra PCI Express Root Port a0 [1def:e101] (rev 04)
000c:00:02.0 PCI bridge [0604]: Ampere Computing, LLC Altra PCI Express Root Port a1 [1def:e102] (rev 04)
000c:00:03.0 PCI bridge [0604]: Ampere Computing, LLC Altra PCI Express Root Port a2 [1def:e103] (rev 04)
000c:00:04.0 PCI bridge [0604]: Ampere Computing, LLC Altra PCI Express Root Port a3 [1def:e104] (rev 04)
000d:00:00.0 Host bridge [0600]: Ampere Computing, LLC Altra PCI Express Root Complex A [1def:e100]
000d:00:01.0 PCI bridge [0604]: Ampere Computing, LLC Altra PCI Express Root Port a0 [1def:e101] (rev 04)
000d:00:02.0 PCI bridge [0604]: Ampere Computing, LLC Altra PCI Express Root Port a1 [1def:e102] (rev 04)
000d:00:03.0 PCI bridge [0604]: Ampere Computing, LLC Altra PCI Express Root Port a2 [1def:e103] (rev 04)
000d:00:04.0 PCI bridge [0604]: Ampere Computing, LLC Altra PCI Express Root Port a3 [1def:e104] (rev 04)
```
-10
View File
@@ -1,10 +0,0 @@
{
imports = [ ../../common/networking/intel/x550 ];
boot.initrd.availableKernelModules = [
"xhci_pci"
"usb_storage"
"nvme"
];
nixpkgs.hostPlatform = "aarch64-linux";
}
-4
View File
@@ -25,10 +25,6 @@
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 = {
+1
View File
@@ -11,6 +11,7 @@ let
mkEnableOption
mkIf
mkMerge
version
versionAtLeast
;
-81
View File
@@ -1,81 +0,0 @@
{
config,
pkgs,
lib,
...
}:
let
inherit (lib)
mkDefault
mkMerge
;
in
{
imports = [
../../../common/cpu/intel/raptor-lake
../../../common/gpu/intel/raptor-lake
../../../common/gpu/nvidia/ada-lovelace
../../../common/gpu/nvidia/prime.nix
../../../common/pc/laptop
../../../common/pc/ssd
];
config = mkMerge [
{
# Configure basic system settings:
boot = {
blacklistedKernelModules = [ "nouveau" ];
kernelModules = [ "kvm-intel" ];
kernelParams = [
"mem_sleep_default=deep"
"pcie_aspm.policy=powersupersave"
"nvidia-drm.modeset=1"
"nvidia-drm.fbdev=1"
];
};
services = {
asusd = {
enable = mkDefault true;
enableUserService = mkDefault true;
};
supergfxd.enable = mkDefault true;
};
#flow devices are 2 in 1 laptops
hardware.sensor.iio.enable = mkDefault true;
hardware = {
nvidia = {
modesetting.enable = true;
nvidiaSettings = mkDefault true;
forceFullCompositionPipeline = mkDefault true;
prime = {
offload = {
enable = mkDefault true;
enableOffloadCmd = mkDefault true;
};
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
powerManagement = {
enable = mkDefault true;
finegrained = mkDefault false;
};
dynamicBoost.enable = mkDefault true;
};
};
}
];
}
-38
View File
@@ -1,38 +0,0 @@
{ lib, ... }:
{
imports = [
../../../common/cpu/amd
../../../common/cpu/amd/pstate.nix
../../../common/gpu/amd
../../../common/gpu/nvidia/prime.nix
../../../common/gpu/nvidia/turing
../../../common/pc/laptop
../../../common/pc/ssd
];
hardware.nvidia = {
# Enable DRM kernel mode setting
# This will also cause "PCI-Express Runtime D3 Power Management" to be enabled by default
modesetting.enable = lib.mkDefault true;
# Dynamic boost is available on ampere GPUs and newer, not this laptop
dynamicBoost.enable = lib.mkDefault false;
prime = {
amdgpuBusId = "PCI:4:0:0";
nvidiaBusId = "PCI:1:0:0";
};
};
services = {
asusd.enable = lib.mkDefault true;
udev.extraHwdb = ''
evdev:name:*:dmi:bvn*:bvr*:bd*:svnASUS*:pn*:*
KEYBOARD_KEY_ff31007c=f20 # fixes mic mute button
KEYBOARD_KEY_ff3100b2=home # Set fn+LeftArrow as Home
KEYBOARD_KEY_ff3100b3=end # Set fn+RightArrow as End
'';
};
}
-10
View File
@@ -1,10 +0,0 @@
{ lib, config, ... }:
let
nvidiaPackage = config.hardware.nvidia.package;
in
{
imports = [ ../. ];
# enable the open source drivers if the package supports it
hardware.nvidia.open = lib.mkOverride 990 (nvidiaPackage ? open && nvidiaPackage ? firmware);
}
-36
View File
@@ -1,36 +0,0 @@
# The x550 supports 5G but the driver does not enable it by default
# https://forum.proxmox.com/threads/x550-x550-t2-duplex-auto-negotiation.116776/
{
systemd.network.links."80-x550" = {
matchConfig = {
Driver = "ixgbe";
Property = [
"ID_MODEL_ID=0x1563"
"ID_VENDOR_ID=0x8086"
];
};
linkConfig.Advertise = [
"100baset-full"
"1000baset-full"
"2500baset-full"
"5000baset-full"
"10000baset-full"
];
linkConfig.NamePolicy = [
"keep"
"kernel"
"database"
"onboard"
"slot"
"path"
];
linkConfig.AlternativeNamesPolicy = [
"database"
"onboard"
"slot"
"path"
"mac"
];
linkConfig.MACAddressPolicy = "persistent";
};
}
+2 -9
View File
@@ -1,13 +1,6 @@
{ config, lib, ... }:
{ lib, config, ... }:
{
imports = [ ../. ];
# Gnome 40 introduced a new way of managing power, without tlp.
# However, these 2 services clash when enabled simultaneously.
# https://github.com/NixOS/nixos-hardware/issues/260
services.tlp.enable = lib.mkDefault (
(lib.versionOlder (lib.versions.majorMinor lib.version) "21.05")
|| !config.services.power-profiles-daemon.enable
);
config.services.power-profiles-daemon.enable = lib.mkDefault (!config.services.tlp.enable);
}
-80
View File
@@ -1,80 +0,0 @@
# MediaTek MT7925 WiFi 7 / Bluetooth support
#
# The MT7925 is a WiFi 7 (802.11be) + Bluetooth combo chip found in many
# 2024-2025 laptops. It requires specific workarounds for stable operation.
#
# Known issues:
# - Power management causes random disconnections
# - ASPM (Active State Power Management) causes hangs
# - CLC (Country Location Code) causes 6GHz band instability
# - WiFi often fails to reconnect after suspend/resume
# - wpa_supplicant has issues; iwd is recommended
#
# Devices using MT7925:
# - Razer Blade 14 (RZ09-0530) 2025
# - ThinkPad P16s Gen 4
# - Other 2024-2025 laptops with WiFi 7
#
# References:
# - https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2118755
# - https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2133863
{
lib,
pkgs,
...
}:
{
# ===========================================================================
# Kernel Recommendation
# ===========================================================================
# Kernel 6.18+ is recommended for stable MT7925 operation.
# Earlier kernels may have driver bugs causing disconnections or hangs.
# Set: boot.kernelPackages = pkgs.linuxPackages_latest;
# ===========================================================================
# Kernel Module Parameters
# ===========================================================================
# Disable power management at driver level during module load
boot.extraModprobeConfig = ''
# MT7925 WiFi - disable all power management for stability
options mt7925e disable_aspm=1
options mt7925e power_save=0
# Disable CLC (Country Location Code) - fixes 6GHz band stability
options mt7925-common disable_clc=1
'';
# ===========================================================================
# NetworkManager Configuration
# ===========================================================================
networking.networkmanager.wifi = {
# Disable WiFi power saving (causes disconnections)
powersave = lib.mkDefault false;
# Consistent MAC during scans (randomization causes issues)
scanRandMacAddress = lib.mkDefault false;
};
# ===========================================================================
# Suspend/Resume Fix
# ===========================================================================
# Restart NetworkManager after suspend to clear stale driver state
systemd.services.mediatek-wifi-resume = {
description = "Restart NetworkManager after suspend to fix MediaTek WiFi";
wantedBy = [
"suspend.target"
"hibernate.target"
"hybrid-sleep.target"
];
after = [
"suspend.target"
"hibernate.target"
"hybrid-sleep.target"
];
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.systemd}/bin/systemctl restart NetworkManager.service";
};
};
}
-34
View File
@@ -1,34 +0,0 @@
# MediaTek MT7925 - iwd backend configuration
#
# Use iwd instead of wpa_supplicant for MT7925. iwd provides better
# stability and faster roaming for WiFi 7 chips.
#
# Import this alongside default.nix:
# imports = [
# ../common/wifi/mediatek/mt7925
# ../common/wifi/mediatek/mt7925/iwd.nix
# ];
{ lib, ... }:
{
# Required for iwd to work with MT7925 - includes non-redistributable firmware
hardware.enableAllFirmware = lib.mkDefault true;
# Use iwd backend instead of wpa_supplicant
networking.networkmanager.wifi.backend = lib.mkDefault "iwd";
# iwd configuration for MT7925 stability
networking.wireless.iwd.settings = {
General = {
# Consistent MAC per network (fixes WPA3 handshake issues)
AddressRandomization = "network";
# Let NetworkManager handle IP configuration, not iwd
# (prevents conflicts between iwd and NetworkManager)
EnableNetworkConfiguration = false;
};
Settings = {
AutoConnect = true;
};
};
}
-3
View File
@@ -8,6 +8,3 @@
`fwupd` is used to receive firmware updates from vendors. This device is in its [supported devices list](https://fwupd.org/lvfs/devices/)
`thermald` is used to achieve better thermal behaviour
##### TLP
TLP is a battery power optimizer for laptops. It is enabled by default, however, since it conflicts with power-profiles-daemon which is GNOME's power management system, TLP will not be installed with if power-profiles-daemon or a recent version of GNOME is present.
+1 -1
View File
@@ -15,7 +15,7 @@
boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"usb-storage"
"usb_storage"
"sd_mod"
"rtsx_pci_sdmmc"
];
+9 -17
View File
@@ -65,7 +65,6 @@
apple-macbook-pro-14-1 = import ./apple/macbook-pro/14-1;
apple-macmini-4-1 = import ./apple/macmini/4;
apple-t2 = import ./apple/t2;
asrock-rack-altrad8ud-1l2t = import ./asrock-rack/altrad8ud-1l2t;
asus-battery = import ./asus/battery.nix;
asus-ally-rc71l = import ./asus/ally/rc71l;
asus-fx504gd = import ./asus/fx504gd;
@@ -75,7 +74,6 @@
asus-fa507rm = import ./asus/fa507rm;
asus-flow-gv302x-amdgpu = import ./asus/flow/gv302x/amdgpu;
asus-flow-gv302x-nvidia = import ./asus/flow/gv302x/nvidia;
asus-flow-gz301vu = import ./asus/flow/gz301vu;
asus-pro-ws-x570-ace = import ./asus/pro-ws-x570-ace;
asus-rog-gl552vw = import ./asus/rog-gl552vw;
asus-rog-strix-g513im = import ./asus/rog-strix/g513im;
@@ -89,7 +87,6 @@
asus-zenbook-ux535 = import ./asus/zenbook/ux535;
asus-zenbook-ux481-intelgpu = import ./asus/zenbook/ux481/intelgpu;
asus-zenbook-ux481-nvidia = import ./asus/zenbook/ux481/nvidia;
asus-zephyrus-ga401iv = import ./asus/zephyrus/ga401iv;
asus-zephyrus-ga401 = import ./asus/zephyrus/ga401;
asus-zephyrus-ga402 = import ./asus/zephyrus/ga402;
asus-zephyrus-ga402x = import ./asus/zephyrus/ga402x;
@@ -175,7 +172,6 @@
framework-amd-ai-300-series = import ./framework/13-inch/amd-ai-300-series;
framework-16-7040-amd = import ./framework/16-inch/7040-amd;
framework-16-amd-ai-300-series = import ./framework/16-inch/amd-ai-300-series;
framework-16-amd-ai-300-series-nvidia = import ./framework/16-inch/amd-ai-300-series/nvidia;
framework-desktop-amd-ai-max-300-series = import ./framework/desktop/amd-ai-max-300-series;
friendlyarm-nanopc-t4 = import ./friendlyarm/nanopc-t4;
friendlyarm-nanopi-r5s = import ./friendlyarm/nanopi-r5s;
@@ -233,14 +229,12 @@
lenovo-legion-16ithg6 = import ./lenovo/legion/16ithg6;
lenovo-legion-16irx8h = import ./lenovo/legion/16irx8h;
lenovo-legion-16irx9h = import ./lenovo/legion/16irx9h;
lenovo-legion-16iax10h = import ./lenovo/legion/16iax10h;
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;
lenovo-thinkpad-e14-amd = import ./lenovo/thinkpad/e14/amd;
lenovo-thinkpad-e14-intel = import ./lenovo/thinkpad/e14/intel;
lenovo-thinkpad-e14-intel-gen2 = import ./lenovo/thinkpad/e14/intel/gen2;
lenovo-thinkpad-e14-intel-gen4 = import ./lenovo/thinkpad/e14/intel/gen4;
lenovo-thinkpad-e14-intel-gen6 = import ./lenovo/thinkpad/e14/intel/gen6;
lenovo-thinkpad-e15-intel = import ./lenovo/thinkpad/e15/intel;
@@ -391,7 +385,6 @@
purism-librem-13v3 = import ./purism/librem/13v3;
purism-librem-15v3 = import ./purism/librem/15v3;
purism-librem-5r4 = import ./purism/librem/5r4;
razer-blade-14-RZ09-0530 = import ./razer/blade/14/RZ09-0530;
raspberry-pi-2 = import ./raspberry-pi/2;
raspberry-pi-3 = import ./raspberry-pi/3;
raspberry-pi-4 = import ./raspberry-pi/4;
@@ -432,16 +425,16 @@
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 = deprecated "992" "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 = 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-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;
@@ -452,7 +445,6 @@
common-gpu-nvidia-nonprime = import ./common/gpu/nvidia;
common-gpu-nvidia-disable = import ./common/gpu/nvidia/disable.nix;
common-hidpi = import ./common/hidpi.nix;
common-networking-intel-x550 = import ./common/networking/intel/x550;
common-pc = import ./common/pc;
common-pc-hdd = import ./common/pc/hdd;
common-pc-laptop = import ./common/pc/laptop;
+1 -1
View File
@@ -13,7 +13,7 @@
"xhci_pci"
"ahci"
"nvme"
"usb-storage"
"usb_storage"
"sd_mod"
"rtsx_pci_sdmmc"
];
@@ -16,19 +16,11 @@
services.fwupd.enable = true;
hardware.framework.laptop13.audioEnhancement.rawDeviceName =
lib.mkDefault "alsa_output.pci-0000_c1_00.6.HiFi__Speaker__sink";
lib.mkDefault "alsa_output.pci-0000_c1_00.6.analog-stereo";
# suspend works with 6.15
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.15") (
lib.mkDefault pkgs.linuxPackages_latest
);
# Disable the broken ALSA UCM profiles by default.
# See https://github.com/NixOS/nixos-hardware/issues/1603
services.pipewire.wireplumber.extraConfig."10-no-ucm" = {
"monitor.alsa.properties" = {
"alsa.use-ucm" = lib.mkDefault false;
};
};
};
}
-4
View File
@@ -18,8 +18,4 @@
++ 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;
}
+11 -94
View File
@@ -1,108 +1,25 @@
# [Framework Laptop 16 — AMD Ryzen AI 300 Series](https://frame.work/)
# [Framework Laptop 16 AMD AI 300 Series](https://frame.work/)
## Recommended modules
## nvidia
### Base (no NVIDIA dGPU module)
If you have an nvidia dGPU module, you can enable it via the nvidia open drivers:
Use the base module:
```nix
{
imports = [
nixos-hardware.nixosModules.framework-16-amd-ai-300-series
];
}
```
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia.open = true; # see the note above
```
### NVIDIA dGPU module (RTX 5070 etc.)
See also [NVIDIA](https://wiki.nixos.org/wiki/NVIDIA) on the NixOS Wiki.
If you have the Framework 16 NVIDIA dGPU module (GeForce RTX 5070 or similar), use the NVIDIA submodule:
## Updating Firmware
```nix
{
imports = [
nixos-hardware.nixosModules.framework-16-amd-ai-300-series-nvidia
];
}
```
Everything is updateable through fwupd, so it's enabled by default.
This enables hybrid graphics with PRIME offload: the AMD iGPU runs by default for better battery life, and the NVIDIA dGPU can be used on demand with `nvidia-offload <command>`.
#### IMPORTANT: You MUST override the PCI bus IDs for your specific system!
The default values are examples only and will likely not match your hardware. Due to Framework 16's modular design, bus IDs vary depending on installed expansion cards and NVMe drives:
```nix
{
hardware.nvidia.prime = {
amdgpuBusId = "PCI:195:0:0"; # Adjust to your system
nvidiaBusId = "PCI:194:0:0"; # Adjust to your system
};
}
```
Find your bus IDs with:
```sh
$ nix-shell -p pciutils --run 'lspci | grep -E "VGA|3D|Display"'
c2:00.0 VGA compatible controller: NVIDIA Corporation ...
c3:00.0 Display controller: Advanced Micro Devices ...
```
Convert the hex bus ID to decimal (e.g., `c2:00.0` → `PCI:194:0:0`, `c3:00.0` → `PCI:195:0:0`).
Helper:
```sh
# Replace BDF with the lspci value like c2:00.0
BDF="c2:00.0"
BUS="${BDF%%:*}"; REST="${BDF#*:}"
DEV="${REST%%.*}"; FUN="${REST#*.}"
printf 'PCI:%d:%d:%d\n' "$((16#$BUS))" "$((16#$DEV))" "$FUN"
```
#### Validate hybrid / offload behavior
```sh
# Default should use AMD
nix-shell -p mesa-demos --run 'glxinfo -B | grep -E "OpenGL vendor|OpenGL renderer"'
# Offload should use NVIDIA
nix-shell -p mesa-demos --run 'nvidia-offload glxinfo -B | grep -E "OpenGL vendor|OpenGL renderer"'
```
To check whether the NVIDIA GPU is runtime-suspending at idle:
```sh
# Reuse $BDF from above
cat /sys/bus/pci/devices/0000:$BDF/power/runtime_status
```
Note: running `nvidia-smi` can wake the GPU, so it is not a reliable “is it sleeping?” probe.
#### Optional: Battery-saver boot entry
If you want an easy “iGPU-only” boot entry (to maximize battery life and avoid loading NVIDIA at all), you can enable the PRIME battery saver specialisation:
```nix
{
hardware.nvidia.primeBatterySaverSpecialisation = true;
}
```
This creates an additional boot entry tagged `battery-saver`.
#### Troubleshooting notes
* If suspend/resume fails after heavy GPU/VRAM usage, see the NixOS NVIDIA wiki for power management / VRAM save notes: https://wiki.nixos.org/wiki/NVIDIA
## Firmware updates (fwupd)
Firmware is updatable via `fwupd` (enabled by default). To get the latest firmware:
To get the latest firmware, run:
```sh
$ fwupdmgr refresh
$ fwupdmgr update
```
- [Latest BIOS update on LVFS](https://fwupd.org/lvfs/devices/work.frame.Laptop16.RyzenAI300.BIOS.firmware)
- [Latest Update](https://fwupd.org/lvfs/devices/work.frame.Laptop16.RyzenAI300.BIOS.firmware)
@@ -18,12 +18,4 @@
# Everything is updateable through fwupd
services.fwupd.enable = true;
# The following mitigations fix various graphics issues
# See https://gist.github.com/lbrame/f9034b1a9fe4fc2d2835c5542acb170a#user-content-quick-version-apply-the-mitigations-i-am-personally-using
boot.kernelParams = [
"amdgpu.dcdebugmask=0x410"
"amdgpu.sg_display=0"
"amdgpu.abmlevel=0"
];
}
@@ -1,28 +0,0 @@
{ lib, ... }:
{
imports = [
../.
../../../../common/gpu/nvidia/blackwell
../../../../common/gpu/nvidia/prime.nix
];
# Explicitly set nvidia as video driver to override modesetting from AMD module
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
# Hybrid graphics with PRIME offload for better battery life
# AMD iGPU by default, NVIDIA dGPU on demand via nvidia-offload command
prime = {
# WARNING: These defaults may not match your system!
# Bus IDs vary depending on installed expansion cards and NVMe drives.
# You MUST override these values - see README.md for instructions.
# Bus IDs can be found with `lspci | grep -E "VGA|3D|Display"`
amdgpuBusId = lib.mkDefault "PCI:195:0:0";
nvidiaBusId = lib.mkDefault "PCI:194:0:0";
};
# Power management for hybrid graphics
powerManagement.enable = lib.mkDefault true;
};
}
-4
View File
@@ -18,8 +18,4 @@
++ 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;
}
-3
View File
@@ -36,9 +36,6 @@ in
"video=DSI-1:panel_orientation=right_side_up"
];
# Turn on IIO for accelerometer screen rotation.
hardware.sensor.iio.enable = lib.mkDefault true;
fonts.fontconfig = {
subpixel.rgba = "vbgr"; # Pixel order for rotated screen
-3
View File
@@ -23,9 +23,6 @@ in
];
};
# Turn on IIO for accelerometer screen rotation.
hardware.sensor.iio.enable = lib.mkDefault true;
fonts.fontconfig = {
subpixel.rgba = "vbgr"; # Pixel order for rotated screen
-5
View File
@@ -10,11 +10,6 @@
"video=eDP-1:panel_orientation=right_side_up"
];
services.tlp.enable = lib.mkDefault (
(lib.versionOlder (lib.versions.majorMinor lib.version) "21.05")
|| !config.services.power-profiles-daemon.enable
);
# Required for grub to properly display the boot menu.
boot.loader.grub.gfxmodeEfi = lib.mkDefault "720x1280x32";
-3
View File
@@ -5,7 +5,6 @@ let
# A patch to get both PWM fans working
# the patch has been successfully applied to 5.15 and 5.19
{
name = "mvebu-gpio-remove-hardcoded-timer-assignment";
patch = pkgs.fetchpatch {
url = "https://raw.githubusercontent.com/armbian/build/bd3466eef2106ea13e85e821f5d852ff97465e6c/patch/kernel/archive/mvebu-5.15/92-mvebu-gpio-remove-hardcoded-timer-assignment.patch";
sha256 = "sha256-eQqMp0+MZd30zkl8DE89oB7czvyqCkfwF2k0EZ69jr0=";
@@ -13,14 +12,12 @@ let
}
# support for Wake-On-Lan
{
name = "mvebu-gpio-add-wake-on-gpio-support";
patch = pkgs.fetchpatch {
url = "https://raw.githubusercontent.com/armbian/build/bd3466eef2106ea13e85e821f5d852ff97465e6c/patch/kernel/archive/mvebu-5.15/92-mvebu-gpio-add_wake_on_gpio_support.patch";
sha256 = "sha256-OrvnVCU55P0U78jdoxGRJvl29i+Rvq8AdEGSCCpxa2I=";
};
}
{
name = "helios4-dts-add-wake-on-lan-support";
patch = pkgs.fetchpatch {
url = "https://raw.githubusercontent.com/armbian/build/bd3466eef2106ea13e85e821f5d852ff97465e6c/patch/kernel/archive/mvebu-5.15/94-helios4-dts-add-wake-on-lan-support.patch";
sha256 = "sha256-ai4161bTC22023eaVVWsvbk6fQKjkv0P4DQ4DA1Zgow=";
-5
View File
@@ -17,9 +17,4 @@
# Cooling management
services.thermald.enable = lib.mkDefault true;
# tlp defaults to "powersave", which doesn't exist on this laptop
services.tlp.settings = {
CPU_SCALING_GOVERNOR_ON_BAT = "schedutil";
};
}
-4
View File
@@ -32,8 +32,4 @@
# Avoid issues with modesetting causing blank screen
services.xserver.videoDrivers = [ "nvidia" ];
# 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;
}
-41
View File
@@ -1,41 +0,0 @@
{
lib,
config,
...
}:
{
imports = [
../../../common/cpu/intel
../../../common/gpu/nvidia/prime.nix
../../../common/gpu/nvidia/blackwell
../../../common/pc/laptop
../../../common/pc/ssd
../../../common/hidpi.nix
];
boot.extraModulePackages = [ config.boot.kernelPackages.lenovo-legion-module ];
hardware = {
nvidia = {
powerManagement.enable = lib.mkDefault true;
#
prime = {
intelBusId = "PCI:00:02:0";
nvidiaBusId = "PCI:02:00:0";
};
};
};
# Sound speaker fix, see #1039
boot.extraModprobeConfig = ''
options snd-hda-intel model=auto
'';
boot.blacklistedKernelModules = [ "snd_soc_avs" ];
# Cooling management
services.thermald.enable = lib.mkDefault true;
# √(2560² + 1600²) px / 16 in ≃ 189 dpi
services.xserver.dpi = 189;
}
@@ -1,11 +0,0 @@
{ lib, ... }:
{
imports = [
../../.
../../../../../common/cpu/intel/tiger-lake
];
services.throttled.enable = lib.mkDefault false;
hardware.intelgpu.driver = "xe";
}
+1 -1
View File
@@ -2,7 +2,7 @@
{
imports = [
../../../common/cpu/intel/kaby-lake
../../../common/cpu/intel
../../../common/pc/ssd
../.
];
+46 -15
View File
@@ -32,23 +32,57 @@ let
else
abort "Invalid kernel version: ${kernelVersion}";
# Fetch the latest linux-surface patches
linux-surface = pkgs.fetchFromGitHub {
owner = "linux-surface";
repo = "linux-surface";
rev = "50d0ed6be462a5fdb643cfe8469bf69158afae42";
hash = "sha256-VEoZH3dFsLn9GnUyjnbOoJeTRM3KEQ9fhlMk03NXoXs=";
};
# Set the version and hash for the linux-surface releases
pkgVersion =
with config.hardware.microsoft-surface;
if kernelVersion == "longterm" then
"6.12.7"
else if kernelVersion == "stable" then
"6.15.3"
else
abort "Invalid kernel version: ${kernelVersion}";
# Fetch and build the kernel
inherit (pkgs.callPackage ./kernel/linux-package.nix { })
pkgHash =
with config.hardware.microsoft-surface;
if kernelVersion == "longterm" then
"sha256-Pv7O8D8ma+MPLhYP3HSGQki+Yczp8b7d63qMb6l4+mY="
else if kernelVersion == "stable" then
"sha256-ozvYrZDiVtMkdCcVnNEdlF2Kdw4jivW0aMJrDynN3Hk="
else
abort "Invalid kernel version: ${kernelVersion}";
# Fetch the linux-surface package
repos =
pkgs.callPackage
(
{
fetchFromGitHub,
rev,
hash,
}:
{
linux-surface = fetchFromGitHub {
owner = "linux-surface";
repo = "linux-surface";
rev = rev;
hash = hash;
};
}
)
{
hash = pkgHash;
rev = "arch-${pkgVersion}-1";
};
# Fetch and build the kernel package
inherit (pkgs.callPackage ./kernel/linux-package.nix { inherit repos; })
linuxPackage
surfacePatches
;
kernelPatches = surfacePatches {
version = srcVersion;
patchFn = ./kernel/${versions.majorMinor srcVersion}/patches.nix;
patchSrc = (linux-surface + "/patches/${versions.majorMinor srcVersion}");
version = pkgVersion;
patchFn = ./kernel/${versions.majorMinor pkgVersion}/patches.nix;
patchSrc = (repos.linux-surface + "/patches/${versions.majorMinor pkgVersion}");
};
kernelPackages = linuxPackage {
inherit kernelPatches;
@@ -76,9 +110,6 @@ in
kernelParams = mkDefault [ "mem_sleep_default=deep" ];
};
# NOTE: Check the README before enabling TLP:
services.tlp.enable = mkDefault false;
# Needed for wifi firmware, see https://github.com/NixOS/nixos-hardware/issues/364
hardware = {
enableRedistributableFirmware = mkDefault true;
@@ -4,6 +4,7 @@
fetchurl,
buildLinux,
linuxPackagesFor,
repos,
}:
let
@@ -73,6 +74,7 @@ in
{
inherit
linuxPackage
repos
surfacePatches
versionsOf
isVersionOf
+1 -1
View File
@@ -5,6 +5,6 @@
...
}:
{
boot.kernelPackages = lib.mkDefault (pkgs.callPackage ./kernel.nix { });
boot.kernelPackages = pkgs.callPackage ./kernel.nix { };
boot.extraModulePackages = [ (config.boot.kernelPackages.callPackage ./lpc.nix { }) ];
}
+15 -12
View File
@@ -7,9 +7,14 @@
...
}:
let
sources = lib.importJSON ./sources.json;
modDirVersion = sources.modDirVersion;
reformDebianPackages = fetchFromGitLab sources.reformDebianPackages;
modDirVersion = "6.16.5";
reformDebianPackages = fetchFromGitLab {
domain = "source.mnt.re";
owner = "reform";
repo = "reform-debian-packages";
rev = "830c94db42beef876dc58ea56711659ae7bd415d";
hash = "sha256-mdORgTOM7RJnEjY5G/iWMHf69wQkql11yRpQ/DrQKb4=";
};
linuxPkg =
{
lib,
@@ -26,17 +31,15 @@ let
src = fetchzip {
url = "mirror://kernel/linux/kernel/v${lib.versions.major modDirVersion}.x/linux-${modDirVersion}.tar.xz";
hash = "sha256-PLMxGXbKztn4MubhKVqSCSzf+UYL50NI48bikMxgghg=";
hash = "sha256-XiTuH40b3VJqzwygZzU0FcvMDj41Rq6IsMbm+3+QxDY=";
};
kernelPatches =
(map (patch: {
name = patch;
patch = "${reformDebianPackages}/${patch}";
}) (import ./kernelPatches.nix))
(map (patch: { inherit patch; }) (
lib.filesystem.listFilesRecursive "${reformDebianPackages}/linux/patches${lib.versions.majorMinor modDirVersion}"
))
++ [
{
name = "reform-dts";
patch = callPackage ./dtsPatch.nix {
inherit reformDebianPackages;
kernelSource = src;
@@ -74,7 +77,7 @@ let
JOYSTICK_XPAD_LEDS = yes;
INTERCONNECT_IMX8MP = yes;
SND_SOC_FSL_ASRC = module; # From the documentation: This option is only useful for out-of-tree drivers since in-tree drivers select it automatically.
SND_SOC_FSL_ASRC = yes;
DRM_IMX_LCDIF = yes;
DRM_IMX8MP_DW_HDMI_BRIDGE = yes;
DRM_IMX8MP_HDMI_PVI = yes;
@@ -127,7 +130,7 @@ let
SPI_ROCKCHIP = yes;
SPI_ROCKCHIP_SFC = module;
ARM_SCMI_CPUFREQ = module;
# VIDEO_ROCKCHIP_VDEC2 = module; # no rkvdec2 patch included any more
VIDEO_ROCKCHIP_VDEC2 = module;
ROCKCHIP_DW_HDMI_QP = yes;
ROCKCHIP_DW_MIPI_DSI2 = yes;
PHY_ROCKCHIP_SAMSUNG_DCPHY = yes;
@@ -135,7 +138,7 @@ let
GPIO_ROCKCHIP = yes;
PL330_DMA = yes;
DRM_ZYNQMP_DPSUB = no; # patches for 6.17 break this driver
DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW = no; # patches for 6.16 break this driver
};
}
// (args.argsOverride or { })
-103
View File
@@ -1,103 +0,0 @@
[
"linux/patches6.17/imx8mp-mnt-pocket-reform/2ghz/0001-imx8mp-2ghz-clk.patch"
"linux/patches6.17/imx8mp-mnt-pocket-reform/2ghz/0002-imx8mp-2ghz-opp.patch"
"linux/patches6.17/imx8mp-mnt-pocket-reform/audio/0000-revert-crashy-audiomix-pm-support.patch"
"linux/patches6.17/imx8mp-mnt-pocket-reform/mmc-sdio/0001-sdhci-add-no-sd-uhs-sdr104-devicetree-property.patch"
"linux/patches6.17/imx8mp-mnt-pocket-reform/mmc-sdio/0002-During-the-card-init-the-host-side-sometimes-may-nee.patch"
"linux/patches6.17/imx8mp-mnt-pocket-reform/mmc-sdio/0003-USDHC-IP-has-one-limitation-the-tuning-circuit-can-t.patch"
"linux/patches6.17/imx8mp-mnt-pocket-reform/pocket-panel/0001-v5-add-multi-display-panel-driver.patch"
"linux/patches6.17/imx8mp-mnt-pocket-reform/pocket-panel/0002-pocket-panel-fix-sleep-add-orientation.patch"
"linux/patches6.17/imx8mp-mnt-reform2/0001-sn65dsi86-use-hs-clock-of-samsung-dsim-host-directly.patch"
"linux/patches6.17/imx8mp-mnt-reform2/0002-lcdif-dont-exceed-desired-pixel-clock.patch"
"linux/patches6.17/imx8mq-mnt-reform2/0001-imx8mq-mnt-reform2.dts-multiple-fixes-for-display-wi.patch"
"linux/patches6.17/imx8mq-mnt-reform2/0001-nwl-dsi-fixup-mode-only-for-LCDIF-input-not-DCSS.patch"
"linux/patches6.17/imx8mq-mnt-reform2/0002-Revert-drm-bridge-nwl-dsi-Use-vsync-hsync-polarity-f.patch"
"linux/patches6.17/imx8mq-mnt-reform2/0003-lcdif-fix-pcie-interference.patch"
"linux/patches6.17/imx8mq-mnt-reform2/0004-mnt4002-imx-gpcv2-wake-smccc.patch.patch"
"linux/patches6.17/imx8mq-mnt-reform2/0005-pci-imx6-add-support-for-internal-refclk-imx8mq.patch"
"linux/patches6.17/imx8mq-mnt-reform2/0006-imx8mq-import-HDMI-driver-and-make-DCSS-compatible-w.patch"
"linux/patches6.17/ls1028a-mnt-reform2/0000-dtsi-add-hdptx.patch"
"linux/patches6.17/meson-g12b-bananapi-cm4-mnt-pocket-reform/0001-a311d-viu-fifo-lines-config.patch"
"linux/patches6.17/meson-g12b-bananapi-cm4-mnt-pocket-reform/0002-a311d-viu-fifo-lines-config-header.patch"
"linux/patches6.17/meson-g12b-bananapi-cm4-mnt-pocket-reform/0003-tlv320aic31xx-add-1228800hz-support.patch"
"linux/patches6.17/meson-g12b-bananapi-cm4-mnt-reform2/0001-Revert-drm-bridge-synopsys-dw-mipi-dsi-enable-EoTp-b.patch"
"linux/patches6.17/meson-g12b-bananapi-cm4-mnt-reform2/0001-meson-g12b-bananapi-cm4-mnt-reform2.dts-fix-audio-an.patch"
"linux/patches6.17/meson-g12b-bananapi-cm4-mnt-reform2/0011-dw-mipi-dsi-phy-stop-wait-time.patch"
"linux/patches6.17/meson-g12b-bananapi-cm4-mnt-reform2/0012-innolux-n125hce-gn1-timing-tweaks.patch"
"linux/patches6.17/meson-g12b-bananapi-cm4-mnt-reform2/0013-meson-viu-hold-fifo-lines.patch"
"linux/patches6.17/meson-g12b-bananapi-cm4-mnt-reform2/0014-meson-venc-sync.patch.patch"
"linux/patches6.17/meson-g12b-bananapi-cm4-mnt-reform2/0015-meson-dw-mipi-dsi-sync-invert.patch"
"linux/patches6.17/meson-g12b-bananapi-cm4-mnt-reform2/0016-sn65dsi86-burst-mode-support.patch"
"linux/patches6.17/meson-g12b-bananapi-cm4-mnt-reform2/0018-sn65dsi86-never-turn-off.patch"
"linux/patches6.17/meson-g12b-bananapi-cm4-mnt-reform2/0020-LOCAL-ALSA-Assign-internal-PCM-chmap-ELD-IEC958-kctl.patch"
"linux/patches6.17/meson-g12b-bananapi-cm4-mnt-reform2/0021-HACK-of-partial-revert-of-fdt.c-changes.patch"
"linux/patches6.17/meson-g12b-bananapi-cm4-mnt-reform2/0022-add-bt-and-eth-resets.patch"
"linux/patches6.17/meson-g12b-bananapi-cm4-mnt-reform2/0023-sdio-pullups.patch"
"linux/patches6.17/meson-g12b-bananapi-cm4-mnt-reform2/0024-sdio-improve-wifi-speed.patch"
"linux/patches6.17/meson-g12b-bananapi-cm4-mnt-reform2/0030-WORKAROUND-meson-plane-disable-afbc-32x8.patch"
"linux/patches6.17/rk3588-mnt-reform2/0001-MERGED-drm-bridge-Pass-down-connector-to-drm-bridge-.patch"
"linux/patches6.17/rk3588-mnt-reform2/0024-math.h-add-DIV_ROUND_UP_NO_OVERFLOW.patch"
"linux/patches6.17/rk3588-mnt-reform2/0025-clk-divider-Fix-divisor-masking-on-64-bit-platforms.patch"
"linux/patches6.17/rk3588-mnt-reform2/0026-clk-composite-replace-open-coded-abs_diff.patch"
"linux/patches6.17/rk3588-mnt-reform2/0030-mfd-rk8xx-Fix-shutdown-handler.patch"
"linux/patches6.17/rk3588-mnt-reform2/0031-dt-bindings-display-vop2-Add-VP-clock-resets.patch"
"linux/patches6.17/rk3588-mnt-reform2/0032-drm-rockchip-vop2-Add-clock-resets-support.patch"
"linux/patches6.17/rk3588-mnt-reform2/0033-arm64-dts-rockchip-Add-VOP-clock-resets-for-rk3588s.patch"
"linux/patches6.17/rk3588-mnt-reform2/0035-drm-rockchip-vop2-Add-core-reset-support.patch"
"linux/patches6.17/rk3588-mnt-reform2/0036-dt-bindings-display-rockchip-Add-schema-for-RK3588-D.patch"
"linux/patches6.17/rk3588-mnt-reform2/0037-drm-bridge-synopsys-Add-DW-DPTX-Controller-support-l.patch"
"linux/patches6.17/rk3588-mnt-reform2/0038-drm-rockchip-Add-RK3588-DPTX-output-support.patch"
"linux/patches6.17/rk3588-mnt-reform2/0042-arm64-dts-rockchip-Add-DP0-for-rk3588.patch"
"linux/patches6.17/rk3588-mnt-reform2/0043-arm64-dts-rockchip-Add-DP1-for-rk3588.patch"
"linux/patches6.17/rk3588-mnt-reform2/0046-arm64-defconfig-Enable-Rockchip-RK3588-DisplayPort-C.patch"
"linux/patches6.17/rk3588-mnt-reform2/0055-phy-rockchip-usbdp-move-orientation-handling-further.patch"
"linux/patches6.17/rk3588-mnt-reform2/0056-phy-rockchip-usbdp-reset-USB3-and-reinit-on-orientat.patch"
"linux/patches6.17/rk3588-mnt-reform2/0063-thermal-rockchip-unify-struct-rockchip_tsadc_chip-fo.patch"
"linux/patches6.17/rk3588-mnt-reform2/0064-thermal-rockchip-shut-up-GRF-warning.patch"
"linux/patches6.17/rk3588-mnt-reform2/0065-thermal-rockchip-simplify-GRF-logic.patch"
"linux/patches6.17/rk3588-mnt-reform2/0067-PCI-dw-rockchip-Add-system-PM-support.patch"
"linux/patches6.17/rk3588-mnt-reform2/0068-drm-bridge-dw-hdmi-qp-Add-CEC-support.patch"
"linux/patches6.17/rk3588-mnt-reform2/0069-drm-bridge-dw-hdmi-qp-Fixup-timer-base-setup.patch"
"linux/patches6.17/rk3588-mnt-reform2/0070-drm-rockchip-dw_hdmi_qp-Improve-error-handling-with-.patch"
"linux/patches6.17/rk3588-mnt-reform2/0071-drm-rockchip-dw_hdmi_qp-Provide-CEC-IRQ-in-dw_hdmi_q.patch"
"linux/patches6.17/rk3588-mnt-reform2/0072-drm-rockchip-dw_hdmi_qp-Provide-ref-clock-rate-in-dw.patch"
"linux/patches6.17/rk3588-mnt-reform2/0073-arm64-defconfig-Enable-DW-HDMI-QP-CEC-support.patch"
"linux/patches6.17/rk3588-mnt-reform2/0075-phy-hdmi-Add-HDMI-2.1-FRL-configuration-options.patch"
"linux/patches6.17/rk3588-mnt-reform2/0076-phy-rockchip-samsung-hdptx-Fix-reported-clock-rate-i.patch"
"linux/patches6.17/rk3588-mnt-reform2/0077-phy-rockchip-samsung-hdptx-Reduce-ROPLL-loop-bandwid.patch"
"linux/patches6.17/rk3588-mnt-reform2/0078-phy-rockchip-samsung-hdptx-Prevent-Inter-Pair-Skew-f.patch"
"linux/patches6.17/rk3588-mnt-reform2/0079-phy-rockchip-samsung-hdptx-Use-usleep_range-instead-.patch"
"linux/patches6.17/rk3588-mnt-reform2/0080-phy-rockchip-samsung-hdptx-Fix-coding-style-alignmen.patch"
"linux/patches6.17/rk3588-mnt-reform2/0081-phy-rockchip-samsung-hdptx-Consistently-use-rk_-hdpt.patch"
"linux/patches6.17/rk3588-mnt-reform2/0082-phy-rockchip-samsung-hdptx-Enable-lane-output-in-com.patch"
"linux/patches6.17/rk3588-mnt-reform2/0083-phy-rockchip-samsung-hdptx-Cleanup-_cmn_init_seq-lis.patch"
"linux/patches6.17/rk3588-mnt-reform2/0084-phy-rockchip-samsung-hdptx-Compute-clk-rate-from-PLL.patch"
"linux/patches6.17/rk3588-mnt-reform2/0085-phy-rockchip-samsung-hdptx-Drop-hw_rate-driver-data.patch"
"linux/patches6.17/rk3588-mnt-reform2/0086-phy-rockchip-samsung-hdptx-Switch-to-driver-specific.patch"
"linux/patches6.17/rk3588-mnt-reform2/0087-phy-rockchip-samsung-hdptx-Extend-rk_hdptx_phy_verif.patch"
"linux/patches6.17/rk3588-mnt-reform2/0088-phy-rockchip-samsung-hdptx-Add-HDMI-2.1-FRL-support.patch"
"linux/patches6.17/rk3588-mnt-reform2/0089-drm-rockchip-vop2-Check-bpc-before-switching-DCLK-so.patch"
"linux/patches6.17/rk3588-mnt-reform2/0090-drm-bridge-dw-hdmi-qp-Handle-platform-supported-form.patch"
"linux/patches6.17/rk3588-mnt-reform2/0091-drm-rockchip-dw_hdmi_qp-Switch-to-phy_configure.patch"
"linux/patches6.17/rk3588-mnt-reform2/0092-drm-rockchip-dw_hdmi_qp-Use-bit-macros-for-RK3576-re.patch"
"linux/patches6.17/rk3588-mnt-reform2/0093-drm-rockchip-dw_hdmi_qp-Add-high-color-depth-support.patch"
"linux/patches6.17/rk3588-mnt-reform2/0094-DEBUG-phy-rockchip-samsung-hdptx-Add-verbose-logging.patch"
"linux/patches6.17/rk3588-mnt-reform2/0095-WIP-SCRAMB-drm-bridge-Add-detect_ctx-hook.patch"
"linux/patches6.17/rk3588-mnt-reform2/0096-WIP-SCRAMB-drm-bridge-connector-Switch-from-detect-t.patch"
"linux/patches6.17/rk3588-mnt-reform2/0097-WIP-SCRAMB-drm-bridge-dw-hdmi-qp-Add-high-TMDS-clock.patch"
"linux/patches6.17/rk3588-mnt-reform2/0098-WIP-YUV420-drm-rockchip-vop2-Add-YUV420-output-forma.patch"
"linux/patches6.17/rk3588-mnt-reform2/0099-WIP-YUV420-drm-rockchip-dw_hdmi_qp-Add-YUV420-output.patch"
"linux/patches6.17/rk3588-mnt-reform2/0100-WIP-FRL-dt-bindings-display-rockchip-Add-tmds-enable.patch"
"linux/patches6.17/rk3588-mnt-reform2/0101-WIP-FRL-drm-rockchip-dw_hdmi_qp-Fixup-usage-of-enabl.patch"
"linux/patches6.17/rk3588-mnt-reform2/0103-WIP-FRL-arm64-dts-rockchip-Assign-ACLK_VOP-to-750-MH.patch"
"linux/patches6.17/rk3588-mnt-reform2/0104-WIP-FRL-drm-connector-hdmi-Handle-FRL-in-hdmi_clock_.patch"
"linux/patches6.17/rk3588-mnt-reform2/0105-WIP-FRL-drm-bridge-dw-hdmi-qp-Add-HDMI-2.1-FRL-suppo.patch"
"linux/patches6.17/rk3588-mnt-reform2/0106-WIP-FRL-drm-rockchip-dw_hdmi_qp-Add-HDMI-2.1-FRL-sup.patch"
"linux/patches6.17/rk3588-mnt-reform2/0107-WIP-FRL-drm-rockchip-vop2-Add-HDMI-2.1-FRL-support.patch"
"linux/patches6.17/rk3588-mnt-reform2/0108-dt-bindings-phy-rockchip-usbdp-add-improved-ports-sc.patch"
"linux/patches6.17/rk3588-mnt-reform2/0114-media-dt-bindings-video-interfaces-add-defines-for-s.patch"
"linux/patches6.17/rk3588-mnt-reform2/0142-drm-bridge-dw-hdmi-qp-Fix-spurious-IRQ-on-resume.patch"
"linux/patches6.17/rk3588-mnt-reform2/2001-drm-bridge-dw-hdmi-qp-Return-0-in-audio-prepare-when.patch"
"linux/patches6.17/rk3588-mnt-reform2/2003-drm-bridge-synopsys-Do-not-warn-about-audio-params-c.patch"
"linux/patches6.17/rk3588-mnt-reform2/5200-drm-rockchip-Set-dma-mask-to-64-bit.patch"
]
+2 -4
View File
@@ -14,8 +14,8 @@ stdenv.mkDerivation rec {
domain = "source.mnt.re";
owner = "reform";
repo = "reform-tools";
rev = "95fff02ea84386e4e9815ee650032b1a5bd6107c";
hash = "sha256-bFiVvpLTboxhA5SmMcf60iazEsgFehabsdqZMZ3APuI=";
rev = "45f930403492aa2156522bfe30edb02e33494b69";
hash = "sha256-no33CsV69nu1TR0cqxQDd1bFXqhjqOW9IUDxds0fyxE=";
};
sourceRoot = "source/lpc";
@@ -26,9 +26,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = kernel.moduleBuildDependencies;
installPhase = ''
runHook preInstall
make -C "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" M="$(pwd)" INSTALL_MOD_PATH=$out modules_install $makeFlags
runHook postInstall
'';
makeFlags = kernelModuleMakeFlags ++ [
-23
View File
@@ -1,23 +0,0 @@
{
lib,
callPackage,
}:
rec {
reform-flash-uboot =
lib.mapAttrs (_name: config: callPackage ./reform-flash-uboot.nix { inherit config; })
{
reform2-rk3588-dsi = {
warn = true;
mmc = "mmcblk0";
mmcBoot0 = false;
ubootOffset = 32768;
flashbinOffset = 0;
image = "${ubootImage.reform2-rk3588-dsi}/rk3588-mnt-reform2-dsi-flash.bin";
};
};
uboot.reform2-rk3588-dsi = callPackage ../rk3588/uboot.nix { };
ubootImage.reform2-rk3588-dsi = callPackage ../rk3588/uboot-image.nix {
uboot = uboot.reform2-rk3588-dsi;
};
}
-44
View File
@@ -1,44 +0,0 @@
{
lib,
writeShellApplication,
config,
}:
let
dev = "/dev/" + config.mmc + lib.optionalString config.mmcBoot0 "boot0";
in
writeShellApplication {
name = "reform-flash-uboot";
text = ''
if [ "$(id -u)" -ne 0 ]; then
echo "reform-flash-uboot has to be run as root / using sudo."
exit 1
fi
''
+ lib.optionalString config.warn ''
echo "W: Flashing u-boot to eMMC on $(cat /proc/device-tree/model) is not without risk." >&2
echo "W: If you flash the wrong u-boot or if the flashing process goes wrong, it is" >&2
echo "W: possible to soft-brick your board. Restoring it might need some extra hardware." >&2
echo "W: Please only proceed if you are sure that the benefits outweigh the risks for you." >&2
printf "Are you sure you want to proceed? [y/N] "
read -r response
if [ "$response" != "y" ]; then
echo "Exiting."
exit
fi
''
+ ''
echo "Writing ${config.image} to ${dev}" >&2
''
+ lib.optionalString config.mmcBoot0 ''
echo 0 >"/sys/class/block/${config.mmc}boot0/force_ro"
''
+ ''
dd if='${config.image}' of='${dev}' bs=512 seek='${
builtins.toString (config.ubootOffset / 512)
}' skip='${builtins.toString (config.flashbinOffset / 512)}'
''
+ lib.optionalString config.mmcBoot0 ''
echo 1 >"/sys/class/block/${config.mmc}boot0/force_ro"
'';
}
+25
View File
@@ -0,0 +1,25 @@
{
runCommand,
uboot,
fetchFromGitHub,
}:
# script from https://source.mnt.re/reform/reform-rk3588-uboot/-/blob/b530d65f4a878c0329a594fa248ba8da59d2e05f/build.sh
runCommand "mnt-reform-firmware-rk3855${uboot.variant}" { } ''
mkdir $out
cp -r ${uboot} u-boot
cp -r ${uboot.rkbin} rkbin
chmod -R +rw u-boot
chmod -R +rw rkbin
cd u-boot
mkdir spl
mv u-boot-spl.bin spl
../rkbin/tools/boot_merger rock5b-rk3588.ini
cd ..
# rkbin stuff
cd rkbin
./tools/boot_merger RKBOOT/RK3588MINIALL.ini
# concatenate
cd ..
cp u-boot/idbloader.img $out/mnt-reform2-rk3588${uboot.variant}-flash.bin
dd if=u-boot/u-boot.itb of=$out/mnt-reform2-rk3588${uboot.variant}-flash.bin seek=16320
''
+3 -3
View File
@@ -44,8 +44,8 @@
storeContents = config.installerImage.storeContents;
comp = config.installerImage.squashfsCompression;
};
packages = pkgs.callPackage ../pkgs { };
ubootImage = packages.ubootImage.reform2-rk3588-dsi;
uboot = pkgs.callPackage ./uboot.nix { };
firmware = pkgs.callPackage ./firmware.nix { inherit uboot; };
content = pkgs.callPackage (
{
stdenv,
@@ -215,7 +215,7 @@
eval $(partx $img -o START,SECTORS --nr 1 --pairs)
dd conv=notrunc if=${content} of=$img seek=$START count=$SECTORS
dd conv=notrunc if=${ubootImage}/rk3588-mnt-reform2-dsi-flash.bin of=$img seek=64
dd conv=notrunc if=${firmware}/mnt-reform2-rk3588-dsi-flash.bin of=$img seek=64
if test -n "$compressImage"; then
zstd -T$NIX_BUILD_CORES --rm $img
-11
View File
@@ -1,11 +0,0 @@
{
runCommand,
uboot,
fetchFromGitHub,
}:
# script from https://source.mnt.re/reform/reform-rk3588-uboot/-/blob/28289e36cd1cb90b302780e83b014250c880c4ec/build.sh
runCommand "mnt-reform-uboot-image-rk3855${uboot.variant}" { } ''
mkdir $out
cp ${uboot}/idbloader.img $out/rk3588-mnt-reform2${uboot.variant}-flash.bin
dd if=${uboot}/u-boot.itb of=$out/rk3588-mnt-reform${uboot.variant}-flash.bin seek=16320
''
+5 -6
View File
@@ -10,14 +10,14 @@ let
domain = "source.mnt.re";
owner = "reform";
repo = "reform-rk3588-uboot";
rev = "28289e36cd1cb90b302780e83b014250c880c4ec";
hash = "sha256-fWGyC+rlfL0NYYRFLvdF7EiO3s9GfFkfhAbTEM5ECAM=";
rev = "55bca0174e7bb449e96028d64ad8348f5af35977";
hash = "sha256-A3u1afGK65cGOwENQtu8Hh+fLsSDNxc3rEebkd3QOic=";
};
rkbin = fetchFromGitHub {
owner = "rockchip-linux";
repo = "rkbin";
rev = "272136301989d493000425935bd4ead0ef04d06b";
hash = "sha256-qXnuZyFNc6gYTkAtPg1t9WHwj8OiTxOLvsHUuvolK/w=";
rev = "f43a462e7a1429a9d407ae52b4745033034a6cf9";
hash = "sha256-geESfZP8ynpUz/i/thpaimYo3kzqkBX95gQhMBzNbmk=";
};
in
buildUBoot rec {
@@ -32,7 +32,6 @@ buildUBoot rec {
patches = [
"${mntPatches}/0001-ini-ddrbin-bump.patch"
"${mntPatches}/0002-add-target-init-mnt-reform-series.patch"
"${mntPatches}/0003-scripts-dtc-pylibfdt-libfdt-i_shipped-Use-SWIG_AppendOutp.patch"
];
prePatch = ''
cp ${mntPatches}/*.dts arch/arm/dts/
@@ -46,7 +45,7 @@ buildUBoot rec {
"spl/u-boot-spl.bin"
];
variant = "-dsi";
defconfig = "rk3588-mnt-reform2${variant}_defconfig";
defconfig = "mnt-reform2-rk3588${variant}_defconfig";
extraMakeFlags = [
"BL31=${armTrustedFirmwareRK3588}/bl31.elf"
"ROCKCHIP_TPL=${rkbin}/bin/rk35/rk3588_ddr_lp4_2112MHz_lp5_2400MHz_v1.18.bin"
-10
View File
@@ -1,10 +0,0 @@
{
"modDirVersion": "6.17.8",
"reformDebianPackages": {
"domain": "source.mnt.re",
"owner": "reform",
"repo": "reform-debian-packages",
"rev": "8268e5ebcf049afad80b470025adba75305d2c80",
"hash": "sha256-Set1jLoiyCAgE9vlRpwsFzDueHmp+B680+JxCVth6+U="
}
}
-10
View File
@@ -1,10 +0,0 @@
let
nixpkgs = import <nixpkgs> { };
pkgs = nixpkgs.pkgs;
lib = nixpkgs.lib;
sources = lib.importJSON ./sources.json;
reformDebianPackages = pkgs.fetchFromGitLab sources.reformDebianPackages;
in
map (lib.removePrefix "${reformDebianPackages}/") (
lib.filesystem.listFilesRecursive "${reformDebianPackages}/linux/patches${lib.versions.majorMinor sources.modDirVersion}"
)
-4
View File
@@ -1,4 +0,0 @@
#!/usr/bin/env sh
nix eval --file updateKernelPatches.nix > kernelPatches.nix
nix fmt kernelPatches.nix
+1 -6
View File
@@ -32,7 +32,6 @@ let
defconfig = "pine64_star64_defconfig";
kernelPatches = [
{
name = "keys-dh-fix";
patch = fetchpatch {
url = "https://github.com/torvalds/linux/commit/215bebc8c6ac438c382a6a56bd2764a2d4e1da72.diff";
hash = "sha256-1ZqmVOkgcDBRkHvVRPH8I5G1STIS1R/l/63PzQQ0z0I=";
@@ -40,16 +39,12 @@ let
};
}
{
name = "starfive-vin-sensor-fix";
patch = fetchpatch {
url = "https://github.com/starfive-tech/linux/pull/108/commits/9ae8cb751c4d1fd2146b279a8e67887590e9d07a.diff";
hash = "sha256-EY0lno+HkY5mradBUPII3qqu0xh+BVQRzveCQcaht0M=";
};
}
{
name = "irq-desc-to-data";
patch = ./irq-desc-to-data.patch;
}
{ patch = ./irq-desc-to-data.patch; }
]
++ kernelPatches;
+2 -2
View File
@@ -14,7 +14,7 @@ lib.mkIf config.hardware.librem5.customInitrdModules {
"tps6598x"
"xhci_hcd"
"usbcore"
"usb-storage"
"usb_storage"
"uas"
"xhci_plat_hcd"
];
@@ -56,7 +56,7 @@ lib.mkIf config.hardware.librem5.customInitrdModules {
"tps6598x"
"xhci_hcd"
"usbcore"
"usb-storage"
"usb_storage"
"uas"
"xhci_plat_hcd"
];
+5 -5
View File
@@ -1,5 +1,6 @@
{
stdenv,
gcc11Stdenv,
buildUBoot,
fetchurl,
fetchFromGitLab,
@@ -27,7 +28,7 @@ let
meta.license = lib.licenses.unfree;
});
arm-trusted-firmware-imx8mq = stdenv.mkDerivation (_fa: {
arm-trusted-firmware-imx8mq = gcc11Stdenv.mkDerivation (_fa: {
pname = "arm-trusted-firmware-bl31";
version = "unstable-2020-07-08";
src = fetchFromGitLab {
@@ -39,7 +40,6 @@ let
};
enableParallelBuilding = true;
hardeningDisable = [ "all" ];
NIX_CFLAGS_COMPILE = "-Wno-error=array-bounds";
NIX_LDFLAGS = "--no-warn-rwx-segments";
buildFlags = [
"PLAT=imx8mq"
@@ -53,14 +53,14 @@ let
});
ubootLibrem5 = buildUBoot {
version = "unstable-2025-03-25";
version = "unstable-2022-12-15";
defconfig = "librem5_defconfig";
src = fetchFromGitLab {
domain = "source.puri.sm";
owner = "Librem5";
repo = "uboot-imx";
rev = "72fcd4ee36e0874daac734c1195263cd9ce9d981"; # this is the latest commit on the upstream/librem5 branch
hash = "sha256-ymqZPuyyZoFTaCMQIJnuNs1fV0uVwJhyQdnGwv9m9lE=";
rev = "956aa590c93977992743b41c45d3c7ee5a024915"; # this is the latest commit on the upstream/librem5 branch
hash = "sha256-MsIIlarN+WFFEzc0ptLAgS7BwJ6Cosy42xo0EwPn1AU=";
};
patches = [ ];
BL31 = "${arm-trusted-firmware-imx8mq}/bl31.bin";
+1 -1
View File
@@ -9,7 +9,7 @@
kernelPackages = lib.mkDefault pkgs.linuxKernel.packages.linux_rpi3;
initrd.availableKernelModules = [
"usbhid"
"usb-storage"
"usb_storage"
];
};
+5 -5
View File
@@ -31,12 +31,11 @@
kernelPackages = lib.mkDefault pkgs.linuxKernel.packages.linux_rpi4;
initrd.availableKernelModules = [
"usbhid"
"usb-storage"
"usb_storage"
"vc4"
"pcie-brcmstb" # required for the pcie bus to work
"pcie_brcmstb" # required for the pcie bus to work
"reset-raspberrypi" # required for vl805 firmware to load
]
++ lib.optional config.boot.initrd.network.enable "genet";
];
# Allow building kernel
initrd.systemd.tpm2.enable = false;
@@ -56,5 +55,6 @@
}
];
hardware.firmware = [ pkgs.raspberrypiWirelessFirmware ];
# Required for the Wireless firmware
hardware.enableRedistributableFirmware = true;
}
+1 -1
View File
@@ -16,7 +16,7 @@ in
initrd.availableKernelModules = [
"nvme"
"usbhid"
"usb-storage"
"usb_storage"
];
};
-68
View File
@@ -1,68 +0,0 @@
# Razer Blade 14 (RZ09-0530)
Model year: 2025
## Hardware Specifications
- **Model:** RZ09-0530
- **CPU:** AMD Ryzen AI 9 HX 370 (Strix Point)
- **iGPU:** AMD Radeon 880M / 890M
- **dGPU:** NVIDIA GeForce RTX 5060 Max-Q (Blackwell)
- **Display:** 14" 2560x1600 OLED, 240Hz
## Identifying Your Model
```bash
nix-shell -p dmidecode --run "sudo dmidecode -s system-product-name"
# Should output: Blade 14 - RZ09-0530
```
## Usage
```nix
{
imports = [
inputs.nixos-hardware.nixosModules.razer-blade-14-RZ09-0530
];
}
```
## Features
This profile configures:
- AMD CPU with microcode updates
- NVIDIA Prime offload (use `nvidia-offload` command for GPU-intensive applications)
- AMD iGPU for early KMS
- Power management for hybrid graphics
- Proper PCI bus IDs for the hybrid GPU setup
## Optional: OpenRazer for RGB Control
If you want to control the Razer RGB keyboard lighting, you can enable OpenRazer:
```nix
{
hardware.openrazer = {
enable = true;
# Disable keyStatistics if using a keyboard remapper like kanata
keyStatistics = false;
users = [ "your-username" ];
};
# Optional: Polychromatic GUI for RGB control
environment.systemPackages = [ pkgs.polychromatic ];
}
```
## Known Issues
- None reported yet
## Additional Notes
- The NVIDIA RTX 5060 Max-Q uses the Blackwell architecture and works with the open kernel modules (`hardware.nvidia.open = true`)
- Fine-grained power management is enabled by default for better battery life
- Use `nvidia-offload <command>` to run applications on the discrete GPU
-60
View File
@@ -1,60 +0,0 @@
{ config, lib, ... }:
let
inherit (lib) mkDefault;
in
{
imports = [
../../../../common/cpu/amd
../../../../common/gpu/amd
../../../../common/gpu/nvidia/prime.nix
../../../../common/pc/laptop
../../../../common/pc/ssd
../../../../common/wifi/mediatek/mt7925
../../../../common/wifi/mediatek/mt7925/iwd.nix
];
# Razer Blade 14 (RZ09-0530 / 2025) - AMD Ryzen AI 9 HX 370 + NVIDIA RTX 5060 Max-Q
# Enable AMD iGPU and NVIDIA dGPU drivers
services.xserver.videoDrivers = mkDefault [
"amdgpu"
"nvidia"
];
hardware = {
# Firmware for AMD CPU/GPU, WiFi, Bluetooth
enableRedistributableFirmware = mkDefault true;
# Enable AMD iGPU in initrd for early KMS
amdgpu.initrd.enable = mkDefault true;
nvidia = {
modesetting.enable = mkDefault true;
nvidiaSettings = mkDefault true;
# Open kernel modules work on Blackwell (RTX 50 series)
open = mkDefault true;
prime = {
offload = {
enable = mkDefault true;
enableOffloadCmd = mkDefault true;
};
# Bus IDs for Razer Blade 14 2025
# Obtained via: nix shell nixpkgs#pciutils -c lspci -d ::03xx
# c4:00.0 (196:0:0) - NVIDIA GeForce RTX 5060 Max-Q
# c5:00.0 (197:0:0) - AMD Radeon 880M / 890M
amdgpuBusId = "PCI:197:0:0";
nvidiaBusId = "PCI:196:0:0";
};
# Power management for hybrid graphics
powerManagement = {
enable = mkDefault true;
finegrained = mkDefault true;
};
};
};
}
+9 -9
View File
@@ -2,11 +2,11 @@
"nodes": {
"nixos-stable": {
"locked": {
"lastModified": 1761597516,
"narHash": "sha256-wxX7u6D2rpkJLWkZ2E932SIvDJW8+ON/0Yy8+a5vsDU=",
"lastModified": 1755274400,
"narHash": "sha256-rTInmnp/xYrfcMZyFMH3kc8oko5zYfxsowaLv1LVobY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "daf6dc47aa4b44791372d6139ab7b25269184d55",
"rev": "ad7196ae55c295f53a7d1ec39e4a06d922f3b899",
"type": "github"
},
"original": {
@@ -18,11 +18,11 @@
},
"nixos-unstable-small": {
"locked": {
"lastModified": 1761789293,
"narHash": "sha256-zwQKLaUgHSpY6SvB/MDgPYRPomWAmbkS3Xfo6JvFVOA=",
"lastModified": 1755375481,
"narHash": "sha256-43PgCQFgFD1nM/7dncytV0c5heNHe/gXrEud18ZWcZU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8d42228a0de7c23b012e2f7dd963425a372e1b0e",
"rev": "35f1742e4f1470817ff8203185e2ce0359947f12",
"type": "github"
},
"original": {
@@ -46,11 +46,11 @@
]
},
"locked": {
"lastModified": 1761311587,
"narHash": "sha256-Msq86cR5SjozQGCnC6H8C+0cD4rnx91BPltZ9KK613Y=",
"lastModified": 1750931469,
"narHash": "sha256-0IEdQB1nS+uViQw4k3VGUXntjkDp7aAlqcxdewb/hAc=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "2eddae033e4e74bf581c2d1dfa101f9033dbd2dc",
"rev": "ac8e6f32e11e9c7f153823abc3ab007f2a65d3e1",
"type": "github"
},
"original": {
-1
View File
@@ -69,7 +69,6 @@ def run_eval_test(gcroot_dir: Path, jobs: int) -> list[str]:
failed_profiles = []
cmd = [
"nix-eval-jobs",
"--no-instantiate",
"--extra-experimental-features", "flakes",
"--option", "eval-cache", "false",
"--gc-roots-dir",