Compare commits

...
Author SHA1 Message Date
steeb-k 92e7eb27a6 Added Lenovo Thinkpad P14s Gen 5 Intel config 2025-03-31 13:06:26 +02:00
Jörg Thalheim daaae13dff Merge pull request #1416 from horscchtey/x13-yoga-thunderbolt
lenovo/thinkpad/x13-yoga: add thunderbolt support
2025-03-19 10:26:01 +01:00
matthiasdotsh 4f4d97d7b7 surface: linux 6.12.18 -> 6.12.19 2025-03-17 13:15:07 +00:00
mkorje 36d0027ef4 apple/t2: add Wi-Fi and Bluetooth firmware option 2025-03-17 13:01:30 +00:00
Cassie Cheung e8c83f0759 apple/t2: sync patches
this includes a new touchpad driver which was tested and should feel
smoother. users may need to re-set touchpad settings in their DE.
2025-03-17 13:01:27 +00:00
Jörg Thalheim fad7119291 Merge pull request #1421 from soopyc/apple-t2/update-option
apple/t2: migrate renamed option
2025-03-17 13:46:08 +01:00
Cassie Cheung 05fa89d1c5 apple/t2: migrate renamed option 2025-03-17 15:23:27 +08:00
dependabot[bot] 113cd39166 build(deps): bump cachix/install-nix-action from 30 to 31
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 30 to 31.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v30...v31)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-17 02:58:53 +00:00
Eva Dengler 3970af5d58 lenovo/thinkpad/x13-yoga: add thunderbolt support 2025-03-14 11:40:45 +01:00
emergentmind e1f1215125 refactor: add model to outputs 2025-03-12 15:18:11 +00:00
emergentmind 09e97074ad refactor: add generic laptop spec 2025-03-12 15:18:11 +00:00
emergentmind 1b1acdc3e7 init 2025-03-12 15:18:11 +00:00
Marien Zwart de70a293ae Adjust README after suspend fix reimplementation
The README still referenced the systemd service we no longer need.
2025-03-12 15:18:05 +00:00
Marien Zwart b416c1d56f Simplify implementation of B550 suspend fix
Instead of using systemd oneshot services that have to be careful to not
toggle wakeups back on, use a udev rule to disable wakeups by device ID.

On a B550 Vision D, these do almost the same thing:

````
$ lspci -n | grep 1022:1483
00:01.1 0604: 1022:1483
00:01.2 0604: 1022:1483
00:03.1 0604: 1022:1483

$ cat /proc/acpi/wakeup
Device  S-state   Status   Sysfs node
...
GPP0      S4    *disabled  pci:0000:00:01.1
GPP8      S4    *disabled  pci:0000:00:03.1
````

Two of the three devices with the PCI vendor/device ID specified by the
udev rule correspond to devices previously disabled via ACPI (if I
understand correctly disabling these via either /proc/acpi/wakeup or
udev device attribute has the same effect).

The third device is (like the other two) using the "pcieport" driver.
Using a device connected via that port as a wakeup device still works.
2025-03-12 15:18:05 +00:00
matthiasdotsh 59314eb9f5 surface: linux 6.12.17 -> 6.12.18 2025-03-12 15:02:32 +00:00
Cryolitia PukNgae 14f45c1a63 gpd-win-max-2-2023/bmi260: 1.0.0 -> 1.1.0
fix: https://github.com/NixOS/nixos-hardware/issues/1352
2025-03-12 15:02:28 +00:00
Ryan Horiguchi d25dac1bd5 dell/xps/13-9350: use lunar-lake cpu config 2025-03-12 14:43:11 +00:00
Erik Alonso b48cc4dab0 pine64/rockpro64: HDMI output and Network in initrd 2025-03-07 05:24:54 +00:00
Johannes Karl Arnold ae546d018a Add support for TUXEDO InfinityBook Pro Intel Gen9 2025-03-07 05:24:51 +00:00
Cassie Cheung 71ab5581a0 apple/t2: update patches 2025-03-07 05:11:21 +00:00
Jörg Thalheim 5335d4303b README: fix typos in the examples and make formatting more consistent 2025-03-07 05:11:18 +00:00
ccritter 52cfc084ef dell/inspiron/7559: add + corresponding Skylake architecture configuration. 2025-03-07 05:11:18 +00:00
matthiasdotsh d23a3bc3c6 surface: linux 6.12.16 -> 6.12.17 2025-03-07 03:55:14 +00:00
Cassie Cheung 009b764ac9 apple/t2: update patches for the latest kernel 2025-02-27 14:16:47 +05:30
Nicky Mouha d58f642ddb Rename dell/e7240 to dell/latitude/e7240 2025-02-24 09:01:14 +00:00
shouya 55e9685ec6 Fix Gigabyte B650 suspend issue (#1385) 2025-02-24 09:29:57 +01:00
ZHANG Yuntian bbf25ca940 radxa: allow platformFirmware to be overridable
Previously, it was a product-level option with a default value.
2025-02-24 08:22:39 +00:00
ZHANG Yuntian 9430c63e02 radxa/rock-pi-e: init 2025-02-24 08:22:39 +00:00
ZHANG Yuntian 76a98e3958 rockchip/rk3328: init 2025-02-24 08:22:39 +00:00
ZHANG Yuntian 9d5dedae84 radxa: clarify that the interface may subject to more changes
We might refactor some parts again when we add Amlogic and Allwinner supports.
2025-02-24 08:22:39 +00:00
ZHANG Yuntian 0b2e2fe9b3 rockchip: support generic firmware installation 2025-02-24 08:22:39 +00:00
ZHANG Yuntian ab84bd93a3 radxa/rock-5b: init 2025-02-24 08:22:39 +00:00
ZHANG Yuntian 28f2a7454f rockchip/rk3588: init 2025-02-24 08:22:39 +00:00
ZHANG Yuntian 79bc209be8 radxa/rock-pi-4: init 2025-02-24 08:22:39 +00:00
ZHANG Yuntian 80340dcf86 rockchip/rk3399: reverse dependency order
This order works better when we have more SoCs.
2025-02-24 08:22:39 +00:00
Andrew Kvalheim 099d38a69e lenovo/thinkpad/p16s/amd/gen2: init
Notes:

- Tested on a model 21K9CTR1WW configured with:
  - AMD Ryzen 7 PRO 7840U with Radeon 780M Graphics
  - 64 GB soldered RAM
  - WQUXGA (3840×2400) OLED display
  - Qualcomm NFA765 wireless network adapter
  - BIOS version R2FET38W (1.18)
- The user guide is shared by:
  - ThinkPad P14s Gen 4
  - ThinkPad P16s Gen 2
  - ThinkPad T14 Gen 4
  - ThinkPad T16 Gen 2
2025-02-24 08:09:24 +00:00
Louis Opter 71cca26f33 Set Alder Lake support for the Aoostar R1 N100
In order to get micro-code updates, and select the right driver for
hardware transcoding on the integrated GPU.
2025-02-24 08:09:21 +00:00
Karolis Stasaitis 8f44cbb48c raspberry-pi-4: poe-hat: add PWM polarity value 2025-02-24 08:09:17 +00:00
Laureηt fb12c8270a dell/xps/13-9315: fix screen flickering 2025-02-24 08:09:14 +00:00
Cassie Cheung cda8312060 apple/t2: format with nixfmt 2025-02-24 08:09:11 +00:00
Cassie Cheung a0252d668c apple/t2: add option to select kernel release 2025-02-24 08:09:11 +00:00
Cassie Cheung d098b09500 apple/t2: refactor kernel package, add stable kernel
Refactors the kernel package to a generic one and adds support for the
lts kernel. Since nixpkgs' kernel packages provide the `kernelPatches`
override, utilizing that ensures that kernel updates are not delayed
too much due to having to PR them to nixos-hardware separately.

This comes at the expense of possible breakage when upstream updates
something that breaks the patches.

Because the T2 Linux project has a lot of patches which changes
periodically, including them in the repository directly is a maintenance
burden. Instead, this patch comes with an update script and JSON files
containing all of the patches to be downloaded (by fetchurl) and
applied.

The NixOS option to enable changing release versions will be added in
the next commit.
2025-02-24 08:09:11 +00:00
Cassie Cheung 04be27ce49 apple/t2: update docs to remove old option
The option was removed in a previous PR but the README was not updated.
Reduce confusion by removing references to the deleted option.
2025-02-24 08:09:11 +00:00
Nicky Mouha 9b49e20140 framework/13-inch/intel-core-ultra-series1: add check for hardware.enableRedistributableFirmware (#1367) 2025-02-24 08:54:44 +01:00
Manuel Transfeld f75203cc31 common/gpu/nvidia: remove a default value (#1373)
https://github.com/NixOS/nixpkgs/pull/326369 has been merged.
2025-02-24 08:48:14 +01:00
matthiasdotsh d2483459e8 surface: linux 6.12.14 -> 6.12.16 2025-02-24 07:44:52 +00:00
Matthieu 18e9f9753e dell-xps-15-9570: fix imports, refactor (closer to recent profiles and more explicit) (#1331) 2025-02-21 05:07:31 +07:00
bashfulrobotandFelix Svensson 3e2ea8a49d feat: Add support for Dell XPS 15-9530 with NVIDIA graphics
- Added `default.nix` file for Dell XPS 15-9530 configuration
- Imported necessary files for CPU, laptop, SSD, and fingerprint
- Enabled thermald service
- Configured iwlwifi module with power saving option
- Removed commented out code for `disable_11ax` option
- Added `default.nix` file for NVIDIA configuration in Dell XPS 15-9530
- Imported `default.nix` file from parent directory and NVIDIA prime configuration file
- Configured `hardware.nvidia.prime` with Bus IDs of Intel and NVIDIA GPUs

[dell/xps/15-9530/default.nix]
- Add a new file `dell/xps/15-9530/default.nix`
- Import the following files: `../../../common/cpu/intel`, `../../../common/pc/laptop`, `../../../common/pc/laptop/ssd`, and `./fingerprint`
- Enable thermald service
- Add configuration for iwlwifi module with `options iwlwifi power_save=1`
- Remove commented out code for `disable_11ax` option
[dell/xps/15-9530/nvidia/default.nix]
- Added a new file `default.nix` in the directory `dell/xps/15-9530/nvidia/`
- The file `default.nix` includes two imports: `../default.nix` and `../../../../common/gpu/nvidia/prime.nix`
- Added a configuration for `hardware.nvidia.prime` which includes the Bus IDs of the Intel and NVIDIA GPUs.

Co-authored-by: Felix Svensson <klowdo.fs@gmail.com>
2025-02-17 13:20:39 +00:00
bashfulrobotandFelix Svensson 08c94a8b62 docs: Add README file for Dell XPS 15 9530
- Add new file `dell/xps/15-9530/README.wiki`
- Specify tested hardware
- Add notes section
- Add NVIDIA Offload section

[dell/xps/15-9530/README.wiki]
- Add a new file `dell/xps/15-9530/README.wiki`
- Specify the tested hardware:
CPU, RAM, HDD, Screen, Graphics, Input
- Add a section for notes
- Add a section for NVIDIA Offload

Co-authored-by: Felix Svensson <klowdo.fs@gmail.com>
2025-02-17 13:20:39 +00:00
⛧-440729 [sophie] e47365f377 purism/librem/5r4: kernel: 6.6.29-librem5 -> 6.6.74-librem5 2025-02-17 13:07:16 +00:00
⛧-440729 [sophie] ba37846397 purism/librem/5r4: update renamed pulseaudio option 2025-02-17 13:07:16 +00:00
matthiasdotsh 4f90da509b surface: linux 6.12.12 -> 6.12.14 2025-02-17 12:53:53 +00:00
Nicky Mouha 2eccff41ba framework/13-inch/intel-core-ultra-series1: Add Intel NPU firmware 2025-02-06 04:36:59 +00:00
Jörg Thalheim d1f201fc62 radxa: add remark about kernel. 2025-02-06 04:19:59 +00:00
ZHANG Yuntian 68cc7a876b radxa/rock-4c-plus: init 2025-02-06 04:19:59 +00:00
ZHANG Yuntian 52047449bf rockchip/rk3399: init 2025-02-06 04:19:59 +00:00
matthiasdotsh c5666d9cd6 surface: linux 6.12.11 -> 6.12.12 2025-02-06 04:19:56 +00:00
Wanja Hentze d85ec4b3c6 hardkernel/odroid-h4: init 2025-02-06 04:19:53 +00:00
aMerryElk 240f698fc8 Added profile for Dell G3 3579 laptop 2025-02-06 04:19:50 +00:00
Samuel d9819a6791 Update default.nix 2025-02-06 04:06:44 +00:00
Jörg Thalheim da7014af5d Revert "framework/13-inch/12th-gen-intel: add hdmi audio fix"
This reverts commit 8b5ef47338.

fixes https://github.com/NixOS/nixos-hardware/issues/1362

Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
2025-02-06 04:06:41 +00:00
Jörg Thalheim 9bdd53f590 Merge pull request #1332 from mkg20001/fwaudio
framework/13-inch/12th-gen-intel: add hdmi audio fix
2025-02-04 10:02:23 +07:00
Jörg Thalheim 537286c3c5 Merge pull request #1357 from tomfitzhenry/no-pbp-ownership
codeowners: remove tomfitzhenry from pinebook-pro
2025-02-02 11:52:41 +07:00
Tom Fitzhenry b8be6f78b0 codeowners: remove tomfitzhenry from pinebook-pro
I no longer use this.
2025-02-02 13:10:46 +11:00
XADE 34b64e4e1d dell-inspiron-3442: init 2025-02-01 06:32:00 +00:00
Cassie Cheung 21fa58535d apple/t2: kernel 6.12.4 -> 6.13 2025-02-01 06:18:21 +00:00
Cassie Cheung 95c8efc0cb apple/t2: remove apple_set_os loader option
the functionality of apple_set_os was upstreamed to the kernel a while
ago and the loader is no longer needed.
2025-02-01 06:18:21 +00:00
Joe 3009bcb058 lenovo/thinkpad/t490s: init 2025-02-01 06:18:18 +00:00
Alex Robbins dfad538f75 dell/latitude/7420: init 2025-01-24 20:47:19 +00:00
M. Ian Graham 7659093598 gpd/pocket-4: default kernel version to 6.12 to fix amdgpu error 2025-01-24 20:47:16 +00:00
Alexander Sosedkin c2aa5756c0 onenetbook/4: update stylus patch for 6.12 2025-01-24 20:47:13 +00:00
matthiasdotsh 3a123626d9 surface: linux 6.12.9 -> 6.12.11 2025-01-24 20:33:51 +00:00
Sandro cbefe8bde7 Fix doc build by adding missing defaultText 2025-01-24 20:33:48 +00:00
Jörg Thalheim 9368027715 Merge pull request #1336 from brianmcgillion/imx8-all
imx8: fix the unused module error accross all imx8
2025-01-23 01:08:30 +01:00
Brian McGillion 6209032a7c fix the unused module error accross all imx8
this fixes the unused modules error that wad introduced by https://github.com/NixOS/nixpkgs/pull/366004

Signed-off-by: Brian McGillion <bmg.avoin@gmail.com>
2025-01-23 01:45:56 +04:00
Jörg Thalheim 5f052b2663 Merge pull request #1335 from brianmcgillion/imx8-fix
nxp-imx: fix unused modules errors
2025-01-22 21:42:38 +01:00
Brian McGillion 63c0f02ce5 nxp-imx: fix unused modules errors
https://github.com/NixOS/nixpkgs/pull/366004
introduced a breaking change that if a module is declared but it is not
being used it will fail.

Signed-off-by: Brian McGillion <bmg.avoin@gmail.com>
2025-01-23 00:17:20 +04:00
Maciej Krüger 8b5ef47338 framework/13-inch/12th-gen-intel: add hdmi audio fix
See https://community.frame.work/t/hdmi-audio-output/9523/23 for more details

Tested on framework 13th gen
Would need somebody to test this on 12th gen aswell
2025-01-21 20:45:47 +01:00
Václav Klecanda 61c79181e7 feat: HP probook 440G5 config 2025-01-20 07:56:42 +00:00
BohdanQQ b539957839 update readme to mention power profile / nvidia-powerd troubleshooting 2025-01-20 07:42:40 +00:00
BohdanQQ 1f23785afe lenovo-legion-16ach6h: enable nvidia.powerd to unlock more gpu power 2025-01-20 07:42:40 +00:00
Jörg Thalheim ce98bebf0f Merge pull request #1029 from xeniarose/framework-amd-kmod
framework: refactor kmod for improved AMD support
2025-01-20 08:25:41 +01:00
Jörg Thalheim e7ac747157 Merge pull request #1319 from LucasFA/omen-15-ce002ns
omen/15-ce002ns: Init
2025-01-20 08:25:17 +01:00
Jörg Thalheim c3e369baa6 Merge pull request #1317 from miangraham/gpd-pocket-4-init
gpd/pocket-4: init
2025-01-20 08:23:00 +01:00
Nicky Mouha cb3173dc5c include Dell Latitude 549 in flake.nix (#1316) 2025-01-19 18:07:52 +01:00
Jörg Thalheim f8d5f4ea3e Merge pull request #1322 from Weathercold/redmibook-16-pro-2024
xiaomi/redmibook/16-pro-2024: init
2025-01-19 18:05:03 +01:00
Weathercold abe22227d7 xiaomi/redmibook/16-pro-2024: init 2025-01-19 14:25:00 +00:00
M. Ian Graham 3883dfe5ee gpd/pocket-4: init 2025-01-17 10:11:37 +09:00
LucasFA b31613ae10 omen/15-ce002ns: Init 2025-01-16 14:33:54 +00:00
โทสตัล b678606690 lenovo-z13-gen2: networking.networkmanager.fccUnlockScripts → networking.modemmanager.fccUnlockScripts
Fixes evaluation warning
2025-01-15 22:00:06 +00:00
Jörg Thalheim 91c1069cba Merge pull request #1310 from Gabgobie/lenovo-ideacentre-k330
Lenovo ideacentre k330
2025-01-15 22:44:29 +01:00
Gabgobie 06c52bbc79 Lenovo IdeaCentre K330 2025-01-11 12:17:58 +01:00
matthiasdotsh 8870dcaff6 surface: linux 6.12.8 -> 6.12.9 2025-01-09 16:55:05 +00:00
Jörg Thalheim e315f86472 Merge pull request #1311 from matdibu/tigerlake-disable-xe
gpu/intel/tiger-lake: don't try to use Xe by default
2025-01-09 17:40:44 +01:00
Matei Dibu d73a04dabf gpu/intel/tiger-lake: don't try to use Xe by default
it doesn't work without a force_probe anyway

see https://github.com/NixOS/nixos-hardware/issues/1278
2025-01-09 16:44:32 +02:00
Samuel 4f339f6be2 oversight 2025-01-07 21:04:53 +00:00
heydoyouknowme0 ca30f8501a asus: init fa506ic 2025-01-07 08:16:54 +00:00
Jörg Thalheim 75a920536c rpi2: switch to extlinux bootloader 2025-01-07 08:16:49 +00:00
Jörg Thalheim 95a812557b update flake.lock 2025-01-07 08:16:49 +00:00
LucasFA 4c5c3be74d Slimbook/hero: Init 2025-01-07 07:44:41 +00:00
Samuel d3b4fe46c8 Adding support for GV302X* 2023 (#1285) 2025-01-07 07:44:38 +00:00
Jörg Thalheim b98df1827a framework/13-inch/7040-amd: remove fprint workaround
fixes https://github.com/NixOS/nixos-hardware/issues/1256
2025-01-07 07:29:08 +00:00
xenia 4c0d42b582 framework: refactor kmod for improved AMD support
Changes several aspects of framework-laptop-kmod support:
- default value has been changed to true when NixOS >= 24.05 and
  linux kernel >=6.10, and false otherwise
- adds required patch for framework AMD enablement when kernel <6.10
- add README section describing usage
2024-12-01 23:04:16 -05:00
115 changed files with 2701 additions and 405 deletions

No files matched your search

+1 -1
View File
@@ -9,5 +9,5 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
- uses: cachix/install-nix-action@v31
- run: nix run ./tests#run .
-1
View File
@@ -5,7 +5,6 @@ dell/xps/15-9560 @Lyndeno
lenovo/thinkpad/x230 @makefu @yegortimoshenko
lenovo/thinkpad/x250 @Mic92
pcengines/apu @yegortimoshenko
pine64/pinebook-pro @tomfitzhenry
pine64/rockpro64 @tomfitzhenry
pine64/star64 @fgaz
purism/librem/13v3 @yegortimoshenko
+33 -5
View File
@@ -91,8 +91,11 @@ See code for all available configurations.
| [Apple MacBook Pro 14,1](apple/macbook-pro/14-1) | `<nixos-hardware/apple/macbook-pro/14-1>` |
| [Apple MacMini (2010, Intel, Nvidia)](apple/macmini/4) | `<nixos-hardware/apple/macmini/4>` |
| [Apple Macs with a T2 Chip](apple/t2) | `<nixos-hardware/apple/t2>` |
| [Aoostar R1 N100](aoostar/r1/n100) | `<nixos-hardware/aoostar/r1/n100>` |
| [Asus Pro WS X570-ACE](asus/pro-ws-x570-ace) | `<nixos-hardware/asus/pro-ws-x570-ace>` |
| [Asus ROG Ally RC71L (2023)](asus/ally/rc71l) | `<nixos-hardware/asus/ally/rc71l>` |
| [Asus ROG Flow X13 GV302X\* (2023)](asus/flow/gv302x/amdgpu) | `<nixos-hardware/asus/flow/gv302x/amdgpu>` |
| [Asus ROG Flow X13 GV302X\* (2023)](asus/flow/gv302x/nvidia) | `<nixos-hardware/asus/flow/gv302x/nvidia>` |
| [Asus ROG Strix G513IM](asus/rog-strix/g513im) | `<nixos-hardware/asus/rog-strix/g513im>` |
| [Asus ROG Strix G713IE](asus/rog-strix/g713ie) | `<nixos-hardware/asus/rog-strix/g713ie>` |
| [Asus ROG Strix G733QS](asus/rog-strix/g733qs) | `<nixos-hardware/asus/rog-strix/g733qs>` |
@@ -107,6 +110,7 @@ See code for all available configurations.
| [Asus ROG Zephyrus M16 GU603H](asus/zephyrus/gu603h) | `<nixos-hardware/asus/zephyrus/gu603h>` |
| [Asus TUF FX504GD](asus/fx504gd) | `<nixos-hardware/asus/fx504gd>` |
| [Asus TUF FX506HM](asus/fx506hm) | `<nixos-hardware/asus/fx506hm>` |
| [Asus TUF FA506IC](asus/fa506ic) | `<nixos-hardware/asus/fa506ic>` |
| [Asus TUF FA507RM](asus/fa507rm) | `<nixos-hardware/asus/fa507rm>` |
| [Asus TUF FA507NV](asus/fa507nv) | `<nixos-hardware/asus/fa507nv>` |
| [Asus Zenbook Flip S13 UX371](asus/zenbook/ux371/) | `<nixos-hardware/asus/zenbook/ux371>` |
@@ -115,19 +119,25 @@ See code for all available configurations.
| [Chuwi MiniBook X](chuwi/minibook-x) | `<nixos-hardware/chuwi/minibook-x>` |
| [Deciso DEC series](deciso/dec) | `<nixos-hardware/deciso/dec>` |
| [Dell G3 3779](dell/g3/3779) | `<nixos-hardware/dell/g3/3779>` |
| [Dell Inspiron 14 5420](dell/inspiron/14-5420) | `<nixos-hardawre/dell/inspiron/14-5420>` |
| [Dell G3 3579](dell/g3/3579) | `<nixos-hardware/dell/g3/3579>` |
| [Dell Inspiron 3442](dell/inspiron/3442) | `<nixos-hardware/dell/inspiron/3442>` |
| [Dell Inspiron 14 5420](dell/inspiron/14-5420) | `<nixos-hardware/dell/inspiron/14-5420>` |
| [Dell Inspiron 5509](dell/inspiron/5509) | `<nixos-hardware/dell/inspiron/5509>` |
| [Dell Inspiron 5515](dell/inspiron/5515) | `<nixos-hardware/dell/inspiron/5515>` |
| [Dell Inspiron 7405](dell/inspiron/7405) | `<nixos-hardware/dell/inspiron/7405>` |
| [Dell Inspiron 7460](dell/inspiron/7460) | `<nixos-hardware/dell/inspiron/7460>` |
| [Dell Inspiron 7559](dell/inspiron/7559) | `<nixos-hardware/dell/inspiron/7559>` |
| [Dell Latitude 3340](dell/latitude/3340) | `<nixos-hardware/dell/latitude/3340>` |
| [Dell Latitude 3480](dell/latitude/3480) | `<nixos-hardware/dell/latitude/3480>` |
| [Dell Latitude 5490](dell/latitude/5490) | `<nixos-hardware/dell/latitude/5490>` |
| [Dell Latitude 5520](dell/latitude/5520) | `<nixos-hardware/dell/latitude/5520>` |
| [Dell Latitude 7280](dell/latitude/7280) | `<nixos-hardware/dell/latitude/7280>` |
| [Dell Latitude 7390](dell/latitude/7390) | `<nixos-hardware/dell/latitude/7390>` |
| [Dell Latitude 7420](dell/latitude/7420) | `<nixos-hardware/dell/latitude/7420>` |
| [Dell Latitude 7430](dell/latitude/7430) | `<nixos-hardware/dell/latitude/7430>` |
| [Dell Latitude 7490](dell/latitude/7490) | `<nixos-hardware/dell/latitude/7490>` |
| [Dell Latitude 9430](dell/latitude/9430) | `<nixos-hardware/dell/latitude/9430>` |
| [Dell Latitude E7240](dell/latitude/e7240) | `<nixos-hardware/dell/latitude/e7240>` |
| [Dell Optiplex 3050](dell/optiplex/3050) | `<nixos-hardware/dell/optiplex/3050>` |
| [Dell Poweredge R7515](dell/poweredge/r7515) | `<nixos-hardware/dell/poweredge/r7515>` |
| [Dell Precision 3541](dell/precision/3541) | `<nixos-hardware/dell/precision/3541>` |
@@ -152,6 +162,8 @@ See code for all available configurations.
| [Dell XPS 15 9510](dell/xps/15-9510) | `<nixos-hardware/dell/xps/15-9510>` |
| [Dell XPS 15 9520, nvidia](dell/xps/15-9520/nvidia) | `<nixos-hardware/dell/xps/15-9520/nvidia>` |
| [Dell XPS 15 9520](dell/xps/15-9520) | `<nixos-hardware/dell/xps/15-9520>` |
| [Dell XPS 15 9530, nvidia](dell/xps/15-9520/nvidia) | `<nixos-hardware/dell/xps/15-9530/nvidia>` |
| [Dell XPS 15 9420](dell/xps/15-9520) | `<nixos-hardware/dell/xps/15-9530>` |
| [Dell XPS 15 9550, nvidia](dell/xps/15-9550/nvidia) | `<nixos-hardware/dell/xps/15-9550/nvidia>` |
| [Dell XPS 15 9550](dell/xps/15-9550) | `<nixos-hardware/dell/xps/15-9550>` |
| [Dell XPS 15 9560, intel only](dell/xps/15-9560/intel) | `<nixos-hardware/dell/xps/15-9560/intel>` |
@@ -163,7 +175,6 @@ See code for all available configurations.
| [Dell XPS 17 9700, intel](dell/xps/17-9700/intel) | `<nixos-hardware/dell/xps/17-9700/intel` |
| [Dell XPS 17 9700, nvidia](dell/xps/17-9700/nvidia) | `<nixos-hardware/dell/xps/17-9700/nvidia>` |
| [Dell XPS 17 9710, intel only](dell/xps/17-9710/intel) | `<nixos-hardware/dell/xps/17-9710/intel>` |
| [Dell XPS E7240](dell/e7240) | `<nixos-hardware/dell/e7240>` |
| [Framework 11th Gen Intel Core](framework/13-inch/11th-gen-intel) | `<nixos-hardware/framework/13-inch/11th-gen-intel>` |
| [Framework 12th Gen Intel Core](framework/13-inch/12th-gen-intel) | `<nixos-hardware/framework/13-inch/12th-gen-intel>` |
| [Framework 13th Gen Intel Core](framework/13-inch/13th-gen-intel) | `<nixos-hardware/framework/13-inch/13th-gen-intel>` |
@@ -174,9 +185,11 @@ See code for all available configurations.
| [FriendlyARM NanoPi R5s](friendlyarm/nanopi-r5s) | `<nixos-hardware/friendlyarm/nanopi-r5s>` |
| [Focus M2 Gen 1](focus/m2/gen1) | `<nixos-hardware/focus/m2/gen1>` |
| [Gigabyte B550](gigabyte/b550) | `<nixos-hardware/gigabyte/b550>` |
| [Gigabyte B650](gigabyte/b650) | `<nixos-hardware/gigabyte/b650>` |
| [GPD MicroPC](gpd/micropc) | `<nixos-hardware/gpd/micropc>` |
| [GPD P2 Max](gpd/p2-max) | `<nixos-hardware/gpd/p2-max>` |
| [GPD Pocket 3](gpd/pocket-3) | `<nixos-hardware/gpd/pocket-3>` |
| [GPD Pocket 4](gpd/pocket-4) | `<nixos-hardware/gpd/pocket-4>` |
| [GPD WIN 2](gpd/win-2) | `<nixos-hardware/gpd/win-2>` |
| [GPD WIN Max 2 2023](gpd/win-max-2/2023) | `<nixos-hardware/gpd/win-max-2/2023>` |
| [GPD WIN Mini 2024](gpd/win-mini/2024) | `<nixos-hardware/gpd/win-mini/2024>` |
@@ -186,11 +199,13 @@ See code for all available configurations.
| [HP Elitebook 845g7](hp/elitebook/845/g7) | `<nixos-hardware/hp/elitebook/845/g7>` |
| [HP Elitebook 845g8](hp/elitebook/845/g8) | `<nixos-hardware/hp/elitebook/845/g8>` |
| [HP Elitebook 845g9](hp/elitebook/845/g9) | `<nixos-hardware/hp/elitebook/845/g9>` |
| [HP Notebook 14-df0023](hp/notebook/14-df0023) | `<nixos-hardware/hp/notebook/14-df0023>` |
| [HP Laptop 14s-dq2024nf](hp/laptop/14s-dq2024nf) | `<nixos-hardware/hp/laptop/14s-dq2024nf>` |
| [HP Notebook 14-df0023](hp/notebook/14-df0023) | `<nixos-hardware/hp/notebook/14-df0023>` |
| [HP Probook 440G5](hp/probook/440g5) | `<nixos-hardware/hp/probook/440g5>` |
| [Huawei Matebook X Pro (2020)](huawei/machc-wa) | `<nixos-hardware/huawei/machc-wa>` |
| [i.MX8QuadMax Multisensory Enablement Kit](nxp/imx8qm-mek/) | `<nixos-hardware/nxp/imx8qm-mek>` |
| [Intel NUC 8i7BEH](intel/nuc/8i7beh/) | `<nixos-hardware/intel/nuc/8i7beh>` |
| [Lenovo IdeaCentre K330](lenovo/ideacentre/k330) | `<nixos-hardware/lenovo/ideacentre/k330>` |
| [Lenovo IdeaPad 3 15alc6](lenovo/ideapad/15alc6) | `<nixos-hardware/lenovo/ideapad/15alc6>` |
| [Lenovo IdeaPad Gaming 3 15arh05](lenovo/ideapad/15arh05) | `<nixos-hardware/lenovo/ideapad/15arh05>` |
| [Lenovo IdeaPad Gaming 3 15ach6](lenovo/ideapad/15ach6) | `<nixos-hardware/lenovo/ideapad/15ach6>` |
@@ -216,6 +231,7 @@ See code for all available configurations.
| [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>` |
| [Lenovo ThinkPad E14 (Intel)](lenovo/thinkpad/e14/intel) | `<nixos-hardware/lenovo/thinkpad/e14/intel>` |
| [Lenovo ThinkPad E15 (Intel)](lenovo/thinkpad/e15/intel) | `<nixos-hardware/lenovo/thinkpad/e15/intel>` |
| [Lenovo ThinkPad E470](lenovo/thinkpad/e470) | `<nixos-hardware/lenovo/thinkpad/e470>` |
| [Lenovo ThinkPad E495](lenovo/thinkpad/e495) | `<nixos-hardware/lenovo/thinkpad/e495>` |
| [Lenovo ThinkPad L13 Yoga](lenovo/thinkpad/l13/yoga) | `<nixos-hardware/lenovo/thinkpad/l13/yoga>` |
@@ -229,7 +245,9 @@ See code for all available configurations.
| [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 P14s Intel Gen 3](lenovo/thinkpad/p14s/intel/gen3) | `<nixos-hardware/lenovo/thinkpad/p14s/intel/gen3>` |
| [Lenovo ThinkPad P14s Intel Gen 5](lenovo/thinkpad/p14s/intel/gen5) | `<nixos-hardware/lenovo/thinkpad/p14s/intel/gen5>` |
| [Lenovo ThinkPad P16s AMD Gen 1](lenovo/thinkpad/p16s/amd/gen1) | `<nixos-hardware/lenovo/thinkpad/p16s/amd/gen1>` |
| [Lenovo ThinkPad P16s AMD Gen 2](lenovo/thinkpad/p16s/amd/gen2) | `<nixos-hardware/lenovo/thinkpad/p16s/amd/gen2>` |
| [Lenovo ThinkPad P1](lenovo/thinkpad/p1) | `<nixos-hardware/lenovo/thinkpad/p1>` |
| [Lenovo ThinkPad P50](lenovo/thinkpad/p50) | `<nixos-hardware/lenovo/thinkpad/p50>` |
| [Lenovo ThinkPad P51](lenovo/thinkpad/p51) | `<nixos-hardware/lenovo/thinkpad/p51>` |
@@ -257,6 +275,7 @@ See code for all available configurations.
| [Lenovo ThinkPad T480](lenovo/thinkpad/t480) | `<nixos-hardware/lenovo/thinkpad/t480>` |
| [Lenovo ThinkPad T480s](lenovo/thinkpad/t480s) | `<nixos-hardware/lenovo/thinkpad/t480s>` |
| [Lenovo ThinkPad T490](lenovo/thinkpad/t490) | `<nixos-hardware/lenovo/thinkpad/t490>` |
| [Lenovo ThinkPad T490s](lenovo/thinkpad/t490s) | `<nixos-hardware/lenovo/thinkpad/t490s>` |
| [Lenovo ThinkPad T495](lenovo/thinkpad/t495) | `<nixos-hardware/lenovo/thinkpad/t495>` |
| [Lenovo ThinkPad T520](lenovo/thinkpad/t520) | `<nixos-hardware/lenovo/thinkpad/t520>` |
| [Lenovo ThinkPad T550](lenovo/thinkpad/t550) | `<nixos-hardware/lenovo/thinkpad/t550>` |
@@ -293,8 +312,8 @@ See code for all available configurations.
| [LENOVO Yoga 6 13ALC6 82ND](lenovo/yoga/6/13ALC6) | `<nixos-hardware/lenovo/yoga/6/13ALC6>` |
| [LENOVO Yoga Slim 7 Pro-X 14ARH7 82ND](lenovo/yoga/7/14ARH7/amdgpu) | `<nixos-hardware/lenovo/yoga/7/14ARH7/amdgpu>` |
| [LENOVO Yoga Slim 7 Pro-X 14ARH7 82ND](lenovo/yoga/7/14ARH7/nvidia) | `<nixos-hardware/lenovo/yoga/7/14ARH7/nvidia>` |
| [Lenovo Yoga Slim 7i Pro X 14IAH7 (Integrated)](lenovo/yoga/7/14IAH7/integrated) |`<nixos-hardware/lenovo/yoga/7/14IAH7/integrated>` |
| [Lenovo Yoga Slim 7i Pro X 14IAH7 (Hybrid)](lenovo/yoga/7/14IAH7/hybrid) |`<nixos-hardware/lenovo/yoga/7/14IAH7/hybrid>` |
| [Lenovo Yoga Slim 7i Pro X 14IAH7 (Integrated)](lenovo/yoga/7/14IAH7/integrated) | `<nixos-hardware/lenovo/yoga/7/14IAH7/integrated>` |
| [Lenovo Yoga Slim 7i Pro X 14IAH7 (Hybrid)](lenovo/yoga/7/14IAH7/hybrid) | `<nixos-hardware/lenovo/yoga/7/14IAH7/hybrid>` |
| [LENOVO Yoga 7 Slim Gen8](lenovo/yoga/7/slim/gen8) | `<nixos-hardware/lenovo/yoga/7/slim/gen8>` |
| [MSI B550-A PRO](msi/b550-a-pro) | `<nixos-hardware/msi/b550-a-pro>` |
| [MSI B350 TOMAHAWK](msi/b350-tomahawk) | `<nixos-hardware/msi/b350-tomahawk>` |
@@ -314,7 +333,9 @@ See code for all available configurations.
| [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>` |
| [Hardkernel Odroid H4](hardkernel/odroid-h4/default.nix) | `<nixos-hardware/hardkernel/odroid-h4>` |
| [Omen 14-fb0798ng](omen/14-fb0798ng) | `<nixos-hardware/omen/14-fb0798ng>` |
| [Omen 15-ce002ns](omen/15-ce002ns) | `<nixos-hardware/omen/15-ce002ns>` |
| [Omen 15-en0010ca](omen/15-en0010ca) | `<nixos-hardware/omen/15-en0010ca>` |
| [Omen 16-n0005ne](omen/16-n0005ne) | `<nixos-hardware/omen/16-n0005ne>` |
| [Omen 16-n0280nd](/omen/16-n0280nd) | `<nixos-hardware/omen/16-n0280nd>` |
@@ -330,11 +351,16 @@ See code for all available configurations.
| [Purism Librem 13v3](purism/librem/13v3) | `<nixos-hardware/purism/librem/13v3>` |
| [Purism Librem 15v3](purism/librem/13v3) | `<nixos-hardware/purism/librem/15v3>` |
| [Purism Librem 5r4](purism/librem/5r4) | `<nixos-hardware/purism/librem/5r4>` |
| [Radxa ROCK 4C+](radxa/rock-4c-plus) | `<nixos-hardware/radxa/rock-4c-plus>` |
| [Radxa ROCK 5 Model B](radxa/rock-5b) | `<nixos-hardware/radxa/rock-5b>` |
| [Radxa ROCK Pi 4](radxa/rock-pi-4) | `<nixos-hardware/radxa/rock-pi-4>` |
| [Radxa ROCK Pi E](radxa/rock-pi-e) | `<nixos-hardware/radxa/rock-pi-e>` |
| [Raspberry Pi 2](raspberry-pi/2) | `<nixos-hardware/raspberry-pi/2>` |
| [Raspberry Pi 3](raspberry-pi/3) | `<nixos-hardware/raspberry-pi/3>` |
| [Raspberry Pi 4](raspberry-pi/4) | `<nixos-hardware/raspberry-pi/4>` |
| [Raspberry Pi 5](raspberry-pi/5) | `<nixos-hardware/raspberry-pi/5>` |
| [Samsung Series 9 NP900X3C](samsung/np900x3c) | `<nixos-hardware/samsung/np900x3c>` |
| [Slimbook Hero RPL-RTX](slimbook/hero/rpl-rtx) | `<nixos-hardware/slimbook/hero/rpl-rtx>` |
| [StarFive VisionFive v1](starfive/visionfive/v1) | `<nixos-hardware/starfive/visionfive/v1>` |
| [StarFive VisionFive 2](starfive/visionfive/v2) | `<nixos-hardware/starfive/visionfive/v2>` |
| [StarLabs StarLite 5 (I5)](starlabs/starlite/i5) | `<nixos-hardware/starlabs/starlite/i5>` |
@@ -350,5 +376,7 @@ See code for all available configurations.
| [Tuxedo InfinityBook v4](tuxedo/infinitybook/v4) | `<nixos-hardware/tuxedo/infinitybook/v4>` |
| [TUXEDO Aura 15 - Gen1](tuxedo/aura/15/gen1) | `<nixos-hardware/tuxedo/aura/15/gen1>` |
| [TUXEDO InfinityBook Pro 14 - Gen7](tuxedo/infinitybook/pro14/gen7) | `<nixos-hardware/tuxedo/infinitybook/pro14/gen7>` |
| [TUXEDO InfinityBook Pro 14 - Gen9 - INTEL](tuxedo/infinitybook/pro14/gen9-intel) | `<nixos-hardware/tuxedo/infinitybook/pro14/gen9-intel>` |
| [TUXEDO Pulse 14 - Gen3](tuxedo/pulse/14/gen3) | `<nixos-hardware/tuxedo/pulse/14/gen3>` |
| [TUXEDO Pulse 15 - Gen2](tuxedo/pulse/15/gen2) | `<nixos-hardware/tuxedo/pulse/15/gen2>` |
| [Xiaomi Redmibook 16 Pro 2024](xiaomi/redmibook/16-pro-2024) | `<nixos-hardware/xiaomi/redmibook/16-pro-2024>` |
+12
View File
@@ -0,0 +1,12 @@
{
imports = [
../../../common/cpu/intel/alder-lake
];
# lopter@(2025-02-06): according to sensors-detect this comes with an ITE
# IT8613E super io chip, which is not officialy supported yet. See also:
#
# - unofficial driver: https://github.com/frankcrawford/it87
# - reddit thread on with useful information to configure pwm from the bios:
# https://www.reddit.com/r/MiniPCs/comments/1bnkg1u/aoostar_r1r7_question_does_the_fan_header_support/
}
+2 -26
View File
@@ -8,29 +8,5 @@ Following [this guide](https://wiki.t2linux.org/distributions/nixos/installation
You can consult the [wiki](https://wiki.t2linux.org/) for information specific to T2 Macs.
## Unlocking Internal iGPU
The `apple-set-os-loader-installer` module serves as an installer for the [`apple-set-os-loader`](https://github.com/Redecorating/apple_set_os-loader). This tool is designed to unlock the internal integrated GPU (iGPU) on certain MacBooks. See https://wiki.t2linux.org/guides/hybrid-graphics/ for more details.
### What it Does:
Upon activation, this module performs the following:
- Renames the existing `BOOTX64.EFI` file to `bootx64_original.efi`.
- Installs the `apple-set-os-loader` hook in its place as `bootx64.efi`.
- Before the system boots the hook unlocks the iGPU and subsequently calls the original `bootx64_original.efi`.
- Enables the iGPU by default.
### How to Implement:
1. Add this into your `configuration.nix`:
```
hardware.apple-t2.enableAppleSetOsLoader = true;
```
2. **Rebuild your system**:
```
sudo nixos-rebuild switch
```
> **Note**: Always ensure compatibility and make backups of your data before making any system changes.
> [!warning]
> Always ensure compatibility and make backups of your data before making any system changes.
+73 -55
View File
@@ -1,6 +1,14 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
inherit (lib) types;
nixosVersion = lib.versions.majorMinor lib.version;
audioFiles = pkgs.fetchFromGitHub {
owner = "kekrby";
repo = "t2-better-audio";
@@ -8,71 +16,86 @@ let
hash = "sha256-x7K0qa++P1e1vuCGxnsFxL1d9+nwMtZUJ6Kd9e27TFs=";
};
audioFilesUdevRules = pkgs.runCommand "audio-files-udev-rules" {} ''
audioFilesUdevRules = pkgs.runCommand "audio-files-udev-rules" { } ''
mkdir -p $out/lib/udev/rules.d
cp ${audioFiles}/files/*.rules $out/lib/udev/rules.d
substituteInPlace $out/lib/udev/rules.d/*.rules --replace "/usr/bin/sed" "${pkgs.gnused}/bin/sed"
'';
overrideAudioFiles = package: pluginsPath:
package.overrideAttrs (new: old: {
preConfigurePhases = old.preConfigurePhases or [ ] ++ [ "postPatchPhase" ];
postPatchPhase = ''
cp -r ${audioFiles}/files/{profile-sets,paths} ${pluginsPath}/alsa/mixer/
'';
});
overrideAudioFiles =
package: pluginsPath:
package.overrideAttrs (
new: old: {
preConfigurePhases = old.preConfigurePhases or [ ] ++ [ "postPatchPhase" ];
postPatchPhase = ''
cp -r ${audioFiles}/files/{profile-sets,paths} ${pluginsPath}/alsa/mixer/
'';
}
);
pipewirePackage = overrideAudioFiles pkgs.pipewire "spa/plugins/";
apple-set-os-loader-installer = pkgs.stdenv.mkDerivation {
name = "apple-set-os-loader-installer-1.0";
src = pkgs.fetchFromGitHub {
owner = "Redecorating";
repo = "apple_set_os-loader";
rev = "r33.9856dc4";
sha256 = "hvwqfoF989PfDRrwU0BMi69nFjPeOmSaD6vR6jIRK2Y=";
};
buildInputs = [ pkgs.gnu-efi ];
buildPhase = ''
substituteInPlace Makefile --replace "/usr" '$(GNU_EFI)'
export GNU_EFI=${pkgs.gnu-efi}
make
'';
installPhase = ''
install -D bootx64_silent.efi $out/bootx64.efi
'';
};
t2Cfg = config.hardware.apple-t2;
in
{
imports = [
(lib.mkRemovedOptionModule ["hardware" "apple-t2" "enableTinyDfr"] ''
(lib.mkRemovedOptionModule [ "hardware" "apple-t2" "enableTinyDfr" ] ''
The hardware.apple-t2.enableTinyDfr option was deprecated and removed since upstream Nixpkgs now has an identical module.
Please migrate to hardware.apple.touchBar.
'')
(lib.mkRemovedOptionModule [ "hardware" "apple-t2" "enableAppleSetOsLoader" ] ''
The hardware.apple-t2.enableAppleSetOsLoader option was removed as the apple_set_os functionality was integrated into the kernel.
Please uninstall the loader by replacing /esp/EFI/BOOTX64.EFI with /esp/EFI/BOOTX64_original.EFI, where esp is the EFI partition mount point.
If you have a device with an AMD dGPU and would like to keep using the iGPU, please set hardware.apple-t2.enableIGPU to true.
'')
];
options.hardware.apple-t2 = {
enableAppleSetOsLoader = lib.mkOption {
default = false;
type = lib.types.bool;
description = "Whether to enable the appleSetOsLoader activation script.";
enableIGPU = lib.mkEnableOption "the usage of the iGPU on specific Apple devices with an AMD dGPU";
kernelChannel = lib.mkOption {
type = types.enum [
"stable"
"latest"
];
default = "stable";
example = "latest";
description = "The kernel release stream to use.";
};
firmware = {
enable = lib.mkEnableOption "automatic and declarative Wi-Fi and Bluetooth firmware configuration";
version = lib.mkOption {
type = types.enum [
"monterey"
"ventura"
"sonoma"
];
default = "sonoma";
example = "ventura";
description = "The macOS version to use.";
};
};
};
config = lib.mkMerge [
{
# For keyboard and touchbar
boot.kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./pkgs/linux-t2.nix { });
# Specialized kernel for keyboard, touchpad, touchbar and audio.
boot.kernelPackages = pkgs.linuxPackagesFor (
pkgs.callPackage (
if t2Cfg.kernelChannel == "stable" then ./pkgs/linux-t2 else ./pkgs/linux-t2/latest.nix
) { }
);
boot.initrd.kernelModules = [ "apple-bce" ];
services.udev.packages = [ audioFilesUdevRules ];
# For audio
boot.kernelParams = [ "pcie_ports=compat" "intel_iommu=on" "iommu=pt" ];
hardware.pulseaudio.package = overrideAudioFiles pkgs.pulseaudio "src/modules/";
boot.kernelParams = [
"pcie_ports=compat"
"intel_iommu=on"
"iommu=pt"
];
services.pipewire.package = pipewirePackage;
services.pipewire.wireplumber.package = pkgs.wireplumber.override {
@@ -82,29 +105,24 @@ in
# Make sure post-resume.service exists
powerManagement.enable = true;
}
(lib.mkIf t2Cfg.enableAppleSetOsLoader {
# Activation script to install apple-set-os-loader in order to unlock the iGPU
system.activationScripts.appleSetOsLoader = ''
if [[ -e /boot/efi/efi/boot/bootx64_original.efi ]]; then
true # It's already installed, no action required
elif [[ -e /boot/efi/efi/boot/bootx64.efi ]]; then
# Copy the new bootloader to a temporary location
cp ${apple-set-os-loader-installer}/bootx64.efi /boot/efi/efi/boot/bootx64_temp.efi
# Rename the original bootloader
mv /boot/efi/efi/boot/bootx64.efi /boot/efi/efi/boot/bootx64_original.efi
# Move the new bootloader to the final destination
mv /boot/efi/efi/boot/bootx64_temp.efi /boot/efi/efi/boot/bootx64.efi
else
echo "Error: /boot/efi/efi/boot/bootx64.efi is missing" >&2
fi
'';
(if lib.versionAtLeast nixosVersion "25.05" then {
services.pulseaudio.package = overrideAudioFiles pkgs.pulseaudio "src/modules/";
} else {
hardware.pulseaudio.package = overrideAudioFiles pkgs.pulseaudio "src/modules/";
})
(lib.mkIf t2Cfg.enableIGPU {
# Enable the iGPU by default if present
environment.etc."modprobe.d/apple-gmux.conf".text = ''
options apple-gmux force_igd=y
'';
})
(lib.mkIf t2Cfg.firmware.enable {
# Configure Wi-Fi and Bluetooth firmware
hardware.firmware = [
(pkgs.callPackage ./pkgs/brcm-firmware { version = t2Cfg.firmware.version; })
];
})
];
}
+89
View File
@@ -0,0 +1,89 @@
{
lib,
stdenvNoCC,
callPackage,
vmTools,
util-linux,
linux,
kmod,
version,
}:
let
get-firmware = callPackage ./get-firmware.nix { };
fetchmacos = callPackage ./fetchmacos.nix { };
# See https://github.com/kholia/OSX-KVM/blob/master/fetch-macOS-v2.py#L534-L546.
# Versions before macOS Monterey don't have Bluetooth firmware.
# Whereas macOS Sequoia doesn't have firmware for MacBook Air 2018 and 2019.
boards = {
monterey = {
boardId = "Mac-B809C3757DA9BB8D";
mlb = "00000000000000000";
osType = "latest";
hash = "sha256-My8FLnqHZn+THfGPIhTSApW/kIWM0ZZhjBxWujhhWPM=";
};
ventura = {
boardId = "Mac-4B682C642B45593E";
mlb = "00000000000000000";
osType = "latest";
hash = "sha256-Qy9Whu8pqHo+m6wHnCIqURAR53LYQKc0r87g9eHgnS4=";
};
sonoma = {
boardId = "Mac-827FAC58A8FDFA22";
mlb = "00000000000000000";
osType = "default";
hash = "sha256-phlpwNTYhugqX2KGljqxpbfGtCFDgggQPzB7U29XSmM=";
};
};
in
vmTools.runInLinuxVM (
stdenvNoCC.mkDerivation {
pname = "brcm-firmware";
inherit version;
src = fetchmacos {
name = version;
inherit (boards.${version})
boardId
mlb
osType
hash
;
};
dontUnpack = true;
nativeBuildInputs = [
util-linux
get-firmware
];
buildPhase = ''
ln -s ${linux}/lib /lib
${kmod}/bin/modprobe loop
${kmod}/bin/modprobe hfsplus
imgdir=$(mktemp -d)
loopdev=$(losetup -f | cut -d "/" -f 3)
losetup -P $loopdev $src
loopdev_partition=/dev/$(lsblk -o KNAME,TYPE,MOUNTPOINT -n | grep $loopdev | tail -1 | awk '{print $1}')
mount $loopdev_partition $imgdir
get-bluetooth $imgdir/usr/share/firmware/bluetooth bluetooth/
get-wifi $imgdir/usr/share/firmware/wifi wifi/
'';
installPhase = ''
mkdir -p $out/lib/firmware/brcm
cp bluetooth/brcm/* $out/lib/firmware/brcm/
cp wifi/brcm/* $out/lib/firmware/brcm/
'';
meta = with lib; {
description = "Wi-Fi and Bluetooth firmware for T2 Macs";
license = licenses.unfree;
maintainers = with maintainers; [ mkorje ];
platforms = platforms.linux;
};
}
)
@@ -0,0 +1,42 @@
{
lib,
stdenvNoCC,
fetchFromGitHub,
callPackage,
dmg2img,
}:
let
macrecovery = callPackage ./macrecovery.nix { };
in
{
name,
boardId,
mlb,
osType,
hash,
}:
stdenvNoCC.mkDerivation {
name = name;
dontUnpack = true;
nativeBuildInputs = [
macrecovery
dmg2img
];
buildPhase = ''
macrecovery download -o . -b ${boardId} -m ${mlb} -os ${osType}
dmg2img -s BaseSystem.dmg fw.img
'';
installPhase = ''
cp fw.img $out
'';
outputHashMode = "recursive";
outputHashAlgo = "sha256";
outputHash = hash;
}
@@ -0,0 +1,133 @@
diff --git a/asahi_firmware/bluetooth.py b/asahi_firmware/bluetooth.py
index 0934225..3eaa442 100644
--- a/asahi_firmware/bluetooth.py
+++ b/asahi_firmware/bluetooth.py
@@ -1,8 +1,25 @@
+#!/usr/bin/env python3
# SPDX-License-Identifier: MIT
import logging, os, os.path, re, sys
from collections import namedtuple, defaultdict
+from hashlib import sha256
-from .core import FWFile
+class FWFile(object):
+ def __init__(self, name, data):
+ self.name = name
+ self.data = data
+ self.sha = sha256(data).hexdigest()
+
+ def __repr__(self):
+ return f"FWFile({self.name!r}, <{self.sha[:16]}>)"
+
+ def __eq__(self, other):
+ if other is None:
+ return False
+ return self.sha == other.sha
+
+ def __hash__(self):
+ return hash(self.sha)
log = logging.getLogger("asahi_firmware.bluetooth")
@@ -127,16 +144,16 @@ class BluetoothFWCollection(object):
if __name__ == "__main__":
col = BluetoothFWCollection(sys.argv[1])
-
- if len(sys.argv) > 2:
- from . import FWPackage
-
- pkg = FWPackage(sys.argv[2])
- pkg.add_files(sorted(col.files()))
- pkg.close()
-
- for i in pkg.manifest:
- print(i)
- else:
- for name, fwfile in col.files():
- print(name, f"{fwfile.name} ({len(fwfile.data)} bytes)")
+
+ dir = os.path.join(sys.argv[2], "brcm")
+ os.makedirs(dir)
+
+ hashes = {}
+ for name, data in sorted(col.files()):
+ path = os.path.join(sys.argv[2], name)
+ if data.sha in hashes:
+ os.link(hashes[data.sha], path)
+ else:
+ with open(path, "wb") as f:
+ f.write(data.data)
+ hashes[data.sha] = path
diff --git a/asahi_firmware/wifi.py b/asahi_firmware/wifi.py
index 346965c..261aa32 100644
--- a/asahi_firmware/wifi.py
+++ b/asahi_firmware/wifi.py
@@ -1,6 +1,24 @@
+#!/usr/bin/env python3
# SPDX-License-Identifier: MIT
import sys, os, os.path, pprint, statistics, logging
-from .core import FWFile
+from hashlib import sha256
+
+class FWFile(object):
+ def __init__(self, name, data):
+ self.name = name
+ self.data = data
+ self.sha = sha256(data).hexdigest()
+
+ def __repr__(self):
+ return f"FWFile({self.name!r}, <{self.sha[:16]}>)"
+
+ def __eq__(self, other):
+ if other is None:
+ return False
+ return self.sha == other.sha
+
+ def __hash__(self):
+ return hash(self.sha)
log = logging.getLogger("asahi_firmware.wifi")
@@ -40,7 +58,9 @@ class WiFiFWCollection(object):
self.prune()
def load(self, source_path):
+ included_folders = ["C-4355__s-C1", "C-4364__s-B2", "C-4364__s-B3", "C-4377__s-B3"]
for dirpath, dirnames, filenames in os.walk(source_path):
+ dirnames[:] = [d for d in dirnames if d in included_folders]
if "perf" in dirnames:
dirnames.remove("perf")
if "assert" in dirnames:
@@ -141,18 +161,16 @@ class WiFiFWCollection(object):
if __name__ == "__main__":
col = WiFiFWCollection(sys.argv[1])
- if len(sys.argv) > 2:
- from .core import FWPackage
-
- pkg = FWPackage(sys.argv[2])
- pkg.add_files(sorted(col.files()))
- pkg.close()
-
- for i in pkg.manifest:
- print(i)
- else:
- for name, fwfile in col.files():
- if isinstance(fwfile, str):
- print(name, "->", fwfile)
- else:
- print(name, f"({len(fwfile.data)} bytes)")
+
+ dir = os.path.join(sys.argv[2], "brcm")
+ os.makedirs(dir)
+
+ hashes = {}
+ for name, data in sorted(col.files()):
+ path = os.path.join(sys.argv[2], name)
+ if data.sha in hashes:
+ os.link(hashes[data.sha], path)
+ else:
+ with open(path, "wb") as f:
+ f.write(data.data)
+ hashes[data.sha] = path
@@ -0,0 +1,35 @@
{
lib,
stdenvNoCC,
fetchFromGitHub,
python3,
}:
stdenvNoCC.mkDerivation {
name = "get-firmware";
src = fetchFromGitHub {
owner = "AsahiLinux";
repo = "asahi-installer";
rev = "v0.7.9";
hash = "sha256-vbhepoZ52k5tW2Gd7tfQTZ5CLqzhV7dUcVh6+AYwECk=";
};
patches = [ ./get-firmware-standalone.patch ];
buildInputs = [ python3 ];
installPhase = ''
cd asahi_firmware
install -Dm755 bluetooth.py $out/bin/get-bluetooth
install -Dm755 wifi.py $out/bin/get-wifi
'';
meta = with lib; {
description = "Patched Asahi Linux Installer scripts to get brcm firmware";
homepage = "https://github.com/AsahiLinux/asahi-installer";
license = licenses.mit;
maintainers = with maintainers; [ mkorje ];
platforms = platforms.all;
};
}
@@ -0,0 +1,36 @@
{
lib,
stdenvNoCC,
fetchFromGitHub,
python3,
}:
stdenvNoCC.mkDerivation {
name = "macrecovery";
src = fetchFromGitHub {
owner = "acidanthera";
repo = "OpenCorePkg";
rev = "1.0.4";
hash = "sha256-5Eypza9teSJSulHaK7Sxh562cTKedXKn3y+Z3+fC6sM=";
};
buildInputs = [ python3 ];
installPhase = ''
cd Utilities/macrecovery
install -Dm755 macrecovery.py $out/opt/macrecovery
cp boards.json $out/opt/boards.json
mkdir $out/bin
ln -s $out/opt/macrecovery $out/bin/macrecovery
'';
meta = with lib; {
description = "A tool that helps to automate recovery interaction";
homepage = "https://github.com/acidanthera/OpenCorePkg";
license = licenses.bsd3;
maintainers = with maintainers; [ mkorje ];
mainProgram = "macrecovery";
platforms = platforms.all;
};
}
-56
View File
@@ -1,56 +0,0 @@
{ lib, buildLinux, fetchFromGitHub, fetchzip, runCommand
, ... } @ args:
let
version = "6.12.4";
majorVersion = lib.elemAt (lib.take 1 (lib.splitVersion version)) 0;
patchRepo = fetchFromGitHub {
owner = "t2linux";
repo = "linux-t2-patches";
rev = "539eea1f9127f1623794ee8c7ccc37e8b00f60a3";
hash = "sha256-pFeNOLTqnEupyEZDk+fX/5GFpobvN+L7Wv2K6V5Xx9g=";
};
kernel = fetchzip {
url = "mirror://kernel/linux/kernel/v${majorVersion}.x/linux-${version}.tar.xz";
hash = "sha256-SiQzaqraT/5s6Mown8/DeOWU7VR3IG0ojvkqThO09+0=";
};
in
buildLinux (args // {
inherit version;
pname = "linux-t2";
# Snippet from nixpkgs
modDirVersion = "${lib.concatStringsSep "." (lib.take 3 (lib.splitVersion "${version}.0"))}";
src = runCommand "patched-source" {} ''
cp -r ${kernel} $out
chmod -R u+w $out
cd $out
while read -r patch; do
echo "Applying patch $patch";
patch -p1 < $patch;
done < <(find ${patchRepo} -type f -name "*.patch" | sort)
'';
structuredExtraConfig = with lib.kernel; {
APPLE_BCE = module;
APPLE_GMUX = module;
APFS_FS = module;
BRCMFMAC = module;
BT_BCM = module;
BT_HCIBCM4377 = module;
BT_HCIUART_BCM = yes;
BT_HCIUART = module;
HID_APPLETB_BL = module;
HID_APPLETB_KBD = module;
HID_APPLE = module;
DRM_APPLETBDRM = module;
HID_SENSOR_ALS = module;
SND_PCM = module;
STAGING = yes;
};
kernelPatches = [];
} // (args.argsOverride or {}))
+6
View File
@@ -0,0 +1,6 @@
{ callPackage, linux_6_12, ... }@args:
callPackage ./generic.nix args {
kernel = linux_6_12;
patchesFile = ./stable.json;
}
+60
View File
@@ -0,0 +1,60 @@
{
lib,
fetchurl, # fetchpatch does unnecessary normalization
...
}@args:
{
kernel,
patchesFile,
}:
let
inherit (builtins) readFile fromJSON;
patchset = fromJSON (readFile patchesFile);
t2-patches = map (
{ name, hash }:
{
inherit name;
patch = fetchurl {
inherit name hash;
url = patchset.base_url + name;
};
}
) patchset.patches;
in
kernel.override (
args
// {
pname = "linux-t2";
structuredExtraConfig = with lib.kernel; {
APPLE_BCE = module;
APPLE_GMUX = module;
APFS_FS = module;
BRCMFMAC = module;
BT_BCM = module;
BT_HCIBCM4377 = module;
BT_HCIUART_BCM = yes;
BT_HCIUART = module;
HID_APPLETB_BL = module;
HID_APPLETB_KBD = module;
HID_APPLE = module;
HID_MAGICMOUSE = module;
DRM_APPLETBDRM = module;
HID_SENSOR_ALS = module;
SND_PCM = module;
STAGING = yes;
};
kernelPatches = t2-patches ++ (args.kernelPatches or [ ]);
argsOverride.extraMeta = {
description = "The Linux kernel (with patches from the T2 Linux project)";
# take responsibility for the downstream kernel
maintainers = with lib.maintainers; [ soopyc ];
};
}
// (args.argsOverride or { })
)
+121
View File
@@ -0,0 +1,121 @@
{
"base_url": "https://raw.githubusercontent.com/t2linux/linux-t2-patches/4109f2144b626097a34b21def849a5d8cbcf3f7c/",
"patches": [
{
"name": "1001-Add-apple-bce-driver.patch",
"hash": "sha256-e3RPvWPj2QASGOS4kieO8YFekrXsBCJtfF82OPlOn2E="
},
{
"name": "1002-Put-apple-bce-in-drivers-staging.patch",
"hash": "sha256-wkveNo1qwAwXWDGTFed4ZDbuBnJbwKgWLmTHK9qq0oM="
},
{
"name": "1005-HID-hid-appletb-bl-add-driver-for-the-backlight-of-A.patch",
"hash": "sha256-kEscS1FAyDxLZPOPInYTXFEf4fouBEa4zGctX14hSu8="
},
{
"name": "1006-HID-hid-appletb-kbd-add-driver-for-the-keyboard-mode.patch",
"hash": "sha256-eVEuvnoRItaDjwWu41nn9bTkgHgY+1SL/hFAvUR2IlY="
},
{
"name": "1007-HID-multitouch-support-getting-the-contact-ID-from.patch",
"hash": "sha256-A4tExJafroVAv/Hbdt7farJM6RYl/DU5KwSbzqcdEVY="
},
{
"name": "1008-HID-multitouch-support-getting-the-tip-state-from-HI.patch",
"hash": "sha256-GwK+d87p3UMy66037dzq6/Zearj8gnRHhqSdZczRadY="
},
{
"name": "1009-HID-multitouch-take-cls-maxcontacts-into-account-for.patch",
"hash": "sha256-fywzHnCQ657UFye1ckiufral3pBwBGtKdxWqWqaFHM0="
},
{
"name": "1010-HID-multitouch-allow-specifying-if-a-device-is-direc.patch",
"hash": "sha256-87SOnLgeG60Svu2Z9QUyP9P6cZ1Gznt6ZYLFImfx+vY="
},
{
"name": "1011-HID-multitouch-add-device-ID-for-Apple-Touch-Bars.patch",
"hash": "sha256-TJjXAlQ4WEROnq/xd6/4JHTuEJjqT7dLLcE4etKdzc0="
},
{
"name": "1014-drm-format-helper-Add-conversion-from-XRGB8888-to-BG.patch",
"hash": "sha256-Ky19+cCiYDaHBh2o5IhZO8J1ExDT7o8K9cgPz+AL8Cg="
},
{
"name": "1015-drm-tiny-add-driver-for-Apple-Touch-Bars-in-x86-Macs.patch",
"hash": "sha256-zFeDJeoM/XS+Ds3DBLEcv4JbUhlEk9z4rHQ4t6XaghA="
},
{
"name": "2008-i915-4-lane-quirk-for-mbp15-1.patch",
"hash": "sha256-f/PTDwRGEyVkGHFyypTKi+gIni3R4TmcsOneGc7Ay5A="
},
{
"name": "2009-apple-gmux-allow-switching-to-igpu-at-probe.patch",
"hash": "sha256-XKwlyJZjJLQz39mc0/S7sPnRnwrqMsq9OKy+QCO+oho="
},
{
"name": "3001-applesmc-convert-static-structures-to-drvdata.patch",
"hash": "sha256-7KGC0pCos351wKNhwJI/Qoc7w+orOPpiTkdCN50G8nI="
},
{
"name": "3002-applesmc-make-io-port-base-addr-dynamic.patch",
"hash": "sha256-1fnmMP/3WSy2JqjdCvxu8tWoshCPr8eiG6ttYK/N9WA="
},
{
"name": "3003-applesmc-switch-to-acpi_device-from-platform.patch",
"hash": "sha256-3S6BzyoPLoirfyAu4yDyE9aYjUYr/7etmAvN3uKSDLE="
},
{
"name": "3004-applesmc-key-interface-wrappers.patch",
"hash": "sha256-9Bq28WcqiOnef0br6bATOudr1ViSpajQs7fv7o8Tg0I="
},
{
"name": "3005-applesmc-basic-mmio-interface-implementation.patch",
"hash": "sha256-Hh9DymQ+Y74oSs1zv9F0lTU3jfAenKTM+cmFH9tmN9Q="
},
{
"name": "3006-applesmc-fan-support-on-T2-Macs.patch",
"hash": "sha256-D5IQHE8QFo49mnUawSau7xUsMFkHKayyhnHW4hi+fWE="
},
{
"name": "3007-applesmc-Add-iMacPro-to-applesmc_whitelist.patch",
"hash": "sha256-rLDuyQYzAaWuu/u6nRRVvGdwyfpLvkGPu1OoD8KS0os="
},
{
"name": "3008-applesmc-make-applesmc_remove-void.patch",
"hash": "sha256-j2Rj1PW/bFEYh9IkGkkG9b+G27IAPCInyd828z4WE1s="
},
{
"name": "3009-applesmc-battery-charge-limiter.patch",
"hash": "sha256-skYKmLsJ6O42/wINLccZWoKS0XhVlC1Nfxi1Ekloxns="
},
{
"name": "4001-asahi-trackpad.patch",
"hash": "sha256-NOuGgUxDQEfFPlij/EnhWmgqeG3/l+j+r2T1YJG7raY="
},
{
"name": "4002-HID-quirks-remove-T2-devices-from-hid_mouse_ignore_l.patch",
"hash": "sha256-DdUo4/4254VD+MzEaLI3opSS0Z7+UwsitJaS2lAlpI8="
},
{
"name": "4003-HID-apple-ignore-the-trackpad-on-T2-Macs.patch",
"hash": "sha256-PZpdvPKvVsLsg3vx3jmq3QCapBUcUVE35N37usBRb6g="
},
{
"name": "4004-HID-magicmouse-Add-support-for-trackpads-found-on-T2.patch",
"hash": "sha256-pmGR0JdMMwGWG3zwMwMBuSyzltLvvzjTgfi1Ii1cglk="
},
{
"name": "7001-drm-i915-fbdev-Discard-BIOS-framebuffers-exceeding-h.patch",
"hash": "sha256-O6RHFxmKZn7aCq1D+r5z2T3jLt0r5+01EABD9rs0E5M="
},
{
"name": "8001-Add-APFS-driver.patch",
"hash": "sha256-T0ZmO99nmnpNVLjlzMRc7wrkBON7w2F6HaPk4pQVV7A="
},
{
"name": "8002-Necessary-modifications-to-build-APFS-with-the-kerne.patch",
"hash": "sha256-n1SH5vC//LRJdWOavH9/BHqBTjkUj5f+dFGitSeHksw="
}
]
}
+6
View File
@@ -0,0 +1,6 @@
{ callPackage, linux_6_13, ... }@args:
callPackage ./generic.nix args {
kernel = linux_6_13;
patchesFile = ./latest.json;
}
+121
View File
@@ -0,0 +1,121 @@
{
"base_url": "https://raw.githubusercontent.com/t2linux/linux-t2-patches/dd2e78d234fc289d3ebadf1852d761498e668a02/",
"patches": [
{
"name": "1001-Add-apple-bce-driver.patch",
"hash": "sha256-e3RPvWPj2QASGOS4kieO8YFekrXsBCJtfF82OPlOn2E="
},
{
"name": "1002-Put-apple-bce-in-drivers-staging.patch",
"hash": "sha256-DXj4CmE7TKMGrAhQDOR5RVw9YHmyQMiXZsmxYfkKAEA="
},
{
"name": "1005-HID-hid-appletb-bl-add-driver-for-the-backlight-of-A.patch",
"hash": "sha256-kEscS1FAyDxLZPOPInYTXFEf4fouBEa4zGctX14hSu8="
},
{
"name": "1006-HID-hid-appletb-kbd-add-driver-for-the-keyboard-mode.patch",
"hash": "sha256-eVEuvnoRItaDjwWu41nn9bTkgHgY+1SL/hFAvUR2IlY="
},
{
"name": "1007-HID-multitouch-support-getting-the-contact-ID-from.patch",
"hash": "sha256-A4tExJafroVAv/Hbdt7farJM6RYl/DU5KwSbzqcdEVY="
},
{
"name": "1008-HID-multitouch-support-getting-the-tip-state-from-HI.patch",
"hash": "sha256-GwK+d87p3UMy66037dzq6/Zearj8gnRHhqSdZczRadY="
},
{
"name": "1009-HID-multitouch-take-cls-maxcontacts-into-account-for.patch",
"hash": "sha256-fywzHnCQ657UFye1ckiufral3pBwBGtKdxWqWqaFHM0="
},
{
"name": "1010-HID-multitouch-allow-specifying-if-a-device-is-direc.patch",
"hash": "sha256-87SOnLgeG60Svu2Z9QUyP9P6cZ1Gznt6ZYLFImfx+vY="
},
{
"name": "1011-HID-multitouch-add-device-ID-for-Apple-Touch-Bars.patch",
"hash": "sha256-TJjXAlQ4WEROnq/xd6/4JHTuEJjqT7dLLcE4etKdzc0="
},
{
"name": "1014-drm-format-helper-Add-conversion-from-XRGB8888-to-BG.patch",
"hash": "sha256-Ky19+cCiYDaHBh2o5IhZO8J1ExDT7o8K9cgPz+AL8Cg="
},
{
"name": "1015-drm-tiny-add-driver-for-Apple-Touch-Bars-in-x86-Macs.patch",
"hash": "sha256-zFeDJeoM/XS+Ds3DBLEcv4JbUhlEk9z4rHQ4t6XaghA="
},
{
"name": "2008-i915-4-lane-quirk-for-mbp15-1.patch",
"hash": "sha256-lZ7MWXZubmAlJCqBmuzueg7agENJbikxP1SE46SmwNw="
},
{
"name": "2009-apple-gmux-allow-switching-to-igpu-at-probe.patch",
"hash": "sha256-XKwlyJZjJLQz39mc0/S7sPnRnwrqMsq9OKy+QCO+oho="
},
{
"name": "3001-applesmc-convert-static-structures-to-drvdata.patch",
"hash": "sha256-7KGC0pCos351wKNhwJI/Qoc7w+orOPpiTkdCN50G8nI="
},
{
"name": "3002-applesmc-make-io-port-base-addr-dynamic.patch",
"hash": "sha256-1fnmMP/3WSy2JqjdCvxu8tWoshCPr8eiG6ttYK/N9WA="
},
{
"name": "3003-applesmc-switch-to-acpi_device-from-platform.patch",
"hash": "sha256-3S6BzyoPLoirfyAu4yDyE9aYjUYr/7etmAvN3uKSDLE="
},
{
"name": "3004-applesmc-key-interface-wrappers.patch",
"hash": "sha256-9Bq28WcqiOnef0br6bATOudr1ViSpajQs7fv7o8Tg0I="
},
{
"name": "3005-applesmc-basic-mmio-interface-implementation.patch",
"hash": "sha256-Hh9DymQ+Y74oSs1zv9F0lTU3jfAenKTM+cmFH9tmN9Q="
},
{
"name": "3006-applesmc-fan-support-on-T2-Macs.patch",
"hash": "sha256-D5IQHE8QFo49mnUawSau7xUsMFkHKayyhnHW4hi+fWE="
},
{
"name": "3007-applesmc-Add-iMacPro-to-applesmc_whitelist.patch",
"hash": "sha256-rLDuyQYzAaWuu/u6nRRVvGdwyfpLvkGPu1OoD8KS0os="
},
{
"name": "3008-applesmc-make-applesmc_remove-void.patch",
"hash": "sha256-j2Rj1PW/bFEYh9IkGkkG9b+G27IAPCInyd828z4WE1s="
},
{
"name": "3009-applesmc-battery-charge-limiter.patch",
"hash": "sha256-skYKmLsJ6O42/wINLccZWoKS0XhVlC1Nfxi1Ekloxns="
},
{
"name": "4001-asahi-trackpad.patch",
"hash": "sha256-NOuGgUxDQEfFPlij/EnhWmgqeG3/l+j+r2T1YJG7raY="
},
{
"name": "4002-HID-quirks-remove-T2-devices-from-hid_mouse_ignore_l.patch",
"hash": "sha256-DdUo4/4254VD+MzEaLI3opSS0Z7+UwsitJaS2lAlpI8="
},
{
"name": "4003-HID-apple-ignore-the-trackpad-on-T2-Macs.patch",
"hash": "sha256-PZpdvPKvVsLsg3vx3jmq3QCapBUcUVE35N37usBRb6g="
},
{
"name": "4004-HID-magicmouse-Add-support-for-trackpads-found-on-T2.patch",
"hash": "sha256-pmGR0JdMMwGWG3zwMwMBuSyzltLvvzjTgfi1Ii1cglk="
},
{
"name": "7001-drm-i915-fbdev-Discard-BIOS-framebuffers-exceeding-h.patch",
"hash": "sha256-O6RHFxmKZn7aCq1D+r5z2T3jLt0r5+01EABD9rs0E5M="
},
{
"name": "8001-Add-APFS-driver.patch",
"hash": "sha256-xjB7lqE4bweUvDa6Tx6LurxWlUlX4nUN+DbTRQb5bQI="
},
{
"name": "8002-Necessary-modifications-to-build-APFS-with-the-kerne.patch",
"hash": "sha256-n1SH5vC//LRJdWOavH9/BHqBTjkUj5f+dFGitSeHksw="
}
]
}
+93
View File
@@ -0,0 +1,93 @@
#!/usr/bin/env nix-shell
#!nix-shell -i python -p nix -p "python3.withPackages (p: [p.requests])"
import argparse
import json
import re
import subprocess
import sys
from tempfile import NamedTemporaryFile
import requests
API_BASE = "https://api.github.com"
PATCH_PATTERN = re.compile(r"^\d{4}-.*\.patch$")
parser = argparse.ArgumentParser(
description="Update linux-t2 patches from a GitHub repository."
)
parser.add_argument("filename", help="the output filename")
parser.add_argument(
"--repository",
help="the source github repository",
default="t2linux/linux-t2-patches",
nargs="?",
)
ref_group = parser.add_mutually_exclusive_group()
ref_group.add_argument(
"--reference", help="the git reference for the patches", default=None, nargs="?"
)
ref_group.add_argument(
"--branch", help="the git branch to fetch", default=None, nargs="?"
)
def get_api(endpoint, *args, **kwargs):
kwargs["headers"] = {"X-GitHub-Api-Version": "2022-11-28"}
response = requests.get(API_BASE + endpoint, *args, **kwargs)
response.raise_for_status()
return response.json()
def get_sri_hash(data: bytes):
with NamedTemporaryFile() as tmpfile:
tmpfile.write(data)
tmpfile.flush()
proc = subprocess.run(
["nix-hash", "--sri", "--flat", "--type", "sha256", tmpfile.name],
check=True,
capture_output=True,
)
return proc.stdout.decode("utf8").strip()
def main():
args = parser.parse_args()
reference = args.reference
branch = args.branch
if reference is None:
if branch is None:
print("Branch and reference not provided, fetching default branch")
branch = get_api(f"/repos/{args.repository}")["default_branch"]
print(f"Reference not provided, fetching from branch {branch}")
branch_data = get_api(f"/repos/{args.repository}/branches/{branch}")
reference = branch_data["commit"]["sha"]
print(f"Repository: {args.repository}")
print(f" Reference: {reference}")
base_url = f"https://raw.githubusercontent.com/{args.repository}/{reference}/"
contents = get_api(f"/repos/{args.repository}/contents", {"ref": reference})
patches = filter(lambda e: PATCH_PATTERN.match(e.get("name")), contents)
patches_with_hash = []
for patch in patches:
patch_content = requests.get(patch["download_url"])
patch_hash = get_sri_hash(patch_content.content)
print(f"{patch['name']}: {patch_hash}")
patches_with_hash.append({"name": patch["name"], "hash": patch_hash})
result = {"base_url": base_url, "patches": patches_with_hash}
with open(args.filename, "w+") as f:
json.dump(result, f, indent=2)
f.write("\n") # write final newline
print(f"Wrote to {args.filename}")
return 0
if __name__ == "__main__":
sys.exit(main())
+33
View File
@@ -0,0 +1,33 @@
{ lib, ... }:
{
imports = [
../../common/cpu/amd
../../common/cpu/amd/pstate.nix
../../common/gpu/amd
../../common/gpu/nvidia/prime.nix
../../common/gpu/nvidia/ampere
../../common/pc/laptop
../../common/pc/laptop/ssd
];
hardware.nvidia = {
modesetting.enable = lib.mkDefault true;
open = lib.mkDefault false;
nvidiaSettings = lib.mkDefault true;
dynamicBoost.enable = lib.mkDefault true;
prime = {
amdgpuBusId = "PCI:0:6:0";
nvidiaBusId = "PCI:0:1:0";
};
};
services = {
asusd = {
enable = lib.mkDefault true;
enableUserService = lib.mkDefault true;
};
supergfxd.enable = lib.mkDefault true;
};
}
+44
View File
@@ -0,0 +1,44 @@
{ config,
lib,
...
}:
let
inherit (lib) mkEnableOption mkIf mkMerge;
cfg = config.hardware.asus.flow.gv302x;
in {
imports = [
../shared.nix
];
options.hardware.asus.flow.gv302x.amdgpu = {
recovery.enable = (mkEnableOption "Enable amdgpu.gpu_recovery kernel boot param") // { default = false; };
sg_display.enable = (mkEnableOption "Enable amdgpu.gpu_recovery kernel boot param") // { default = true; };
psr.enable = (mkEnableOption "Enable amdgpu.dcdebugmask=0x10 kernel boot param") // { default = true; };
};
config = mkMerge [
(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...)
boot.kernelParams = [
"amdgpu.gpu_recovery=1"
];
})
(mkIf (!cfg.amdgpu.sg_display.enable) {
# Can help solve flickering/glitching display issues since Scatter/Gather code was reenabled
boot.kernelParams = [
"amdgpu.sg_display=0"
];
})
(mkIf (!cfg.amdgpu.psr.enable) {
# Can help solve flickering/glitching display issues since Scatter/Gather code was reenabled
boot.kernelParams = [
"amdgpu.dcdebugmask=0x10"
];
})
];
}
+55
View File
@@ -0,0 +1,55 @@
{ lib,
pkgs,
config,
...
}:
let
inherit (lib) mkDefault;
in {
imports = [
../shared.nix
## "prime.nix" loads this, aleady:
# ../../../common/gpu/nvidia
../../../../common/gpu/nvidia/prime.nix
../../../../common/gpu/nvidia/ada-lovelace
];
# NVIDIA GeForce RTX 4070 Mobile
boot = {
blacklistedKernelModules = [ "nouveau" ];
};
hardware = {
## Enable the Nvidia card, as well as Prime and Offload:
amdgpu.initrd.enable = mkDefault true;
nvidia = {
modesetting.enable = true;
nvidiaSettings = mkDefault true;
prime = {
offload = {
enable = mkDefault true;
enableOffloadCmd = mkDefault true;
};
amdgpuBusId = "PCI:69:0:0";
nvidiaBusId = "PCI:1:0:0";
};
powerManagement = {
enable = mkDefault true;
finegrained = mkDefault true;
};
dynamicBoost.enable = mkDefault true;
};
};
}
+106
View File
@@ -0,0 +1,106 @@
{ config,
pkgs,
lib,
...
}:
let
inherit (lib) mkDefault mkEnableOption mkIf mkMerge version versionAtLeast versionOlder;
cfg = config.hardware.asus.flow.gv302x;
in {
imports = [
../../../common/cpu/amd
# Better power-savings from AMD PState:
../../../common/cpu/amd/pstate.nix
../../../common/gpu/amd
../../../common/pc/laptop
../../../common/pc/ssd
];
options.hardware.asus.flow.gv302x = {
# Kernels earlier than 6.9 (possibly even earlier) tend to take 1-2 key-presses
# to wake-up the internal keyboard after the device is suspended.
# Therefore, this option disables auto-suspend for the keyboard by default, but
# enables it for kernel 6.9.x onwards.
#
# Note: the device name is "ASUS N-KEY Device".
keyboard.autosuspend.enable = (
mkEnableOption "Enable auto-suspend on the internal USB keyboard (ASUS N-KEY Device) on Flow GV302X"
) // {
default = versionAtLeast config.boot.kernelPackages.kernel.version "6.9";
defaultText = lib.literalExpression "lib.versionAtLeast config.boot.kernelPackages.kernel.version \"6.9\"";
};
# The ASUS 8295 ITE device will cause an immediate wake-up when trying to suspend the laptop.
# After the first successful hibernate, it will work as expected, however.
# NOTE: I'm not actually sure what this device, as neither the touchpad nor the M1-M4 keys cause a wake-up.
ite-device.wakeup.enable = mkEnableOption "Enable power wakeup on the internal USB keyboard-like device (8295 ITE Device) on Flow GV302X";
};
config = mkMerge [
{
# Configure basic system settings:
boot = {
kernelModules = [ "kvm-amd" ];
kernelParams = [
"mem_sleep_default=deep"
"pcie_aspm.policy=powersupersave"
];
};
services = {
asusd = {
enable = mkDefault true;
enableUserService = mkDefault true;
};
supergfxd.enable = mkDefault true;
udev = {
extraHwdb = ''
# Fixes mic mute button
evdev:name:*:dmi:bvn*:bvr*:bd*:svnASUS*:pn*:*
KEYBOARD_KEY_ff31007c=f20
'';
};
};
#flow devices are 2 in 1 laptops
hardware.sensor.iio.enable = mkDefault true;
}
(mkIf (! cfg.keyboard.autosuspend.enable) {
services.udev.extraRules = ''
# Disable power auto-suspend for the ASUS N-KEY device, i.e. USB Keyboard.
# Otherwise on certain kernel-versions, it will tend to take 1-2 key-presses to wake-up after the device suspends.
ACTION=="add", SUBSYSTEM=="usb", TEST=="power/autosuspend", ATTR{idVendor}=="0b05", ATTR{idProduct}=="19b6", ATTR{power/autosuspend}="-1"
'';
})
(mkIf (! cfg.ite-device.wakeup.enable) {
services.udev.extraRules = ''
# Disable power wakeup for the 8295 ITE device.
# Otherwise on certain kernel-versions, it will tend to cause the laptop to immediately wake-up when suspending.
# ACTION=="add|change", SUBSYSTEM=="usb", DRIVER="usb", TEST="power/wakeup", ATTR{idVendor}=="0b05", ATTR{idProduct}=="193b", ATTR{power/wakeup}="disabled"
ACTION=="add|change", SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="193b", ATTR{power/wakeup}="disabled"
'';
})
(mkIf (config.networking.wireless.iwd.enable && config.networking.wireless.scanOnLowSignal) {
# Meditek doesn't seem to be quite sensitive enough on the default roaming settings:
# https://wiki.archlinux.org/title/Wpa_supplicant#Roaming
# https://wiki.archlinux.org/title/Iwd#iwd_keeps_roaming
#
# But NixOS doesn't have the tweaks for IWD, yet.
networking.wireless.iwd.settings = {
General = {
RoamThreshold = -75;
RoamThreshold5G = -80;
RoamRetryInterval = 20;
};
};
})
];
}
+5
View File
@@ -0,0 +1,5 @@
{
imports = [
../cpu-only.nix
];
}
+6
View File
@@ -0,0 +1,6 @@
{
imports = [
./cpu-only.nix
../../../gpu/intel/skylake
];
}
+18
View File
@@ -0,0 +1,18 @@
{ pkgs, ... }:
{
imports = [ ../. ];
boot.kernelParams = [
"i915.enable_guc=2"
];
# VP9 decoding not supported when using intel-media-driver
# https://github.com/intel/media-driver/issues/1024
# NixOS Wiki recommends using the legacy intel-vaapi-driver with the hybrid codec over that one for Skylake.
# https://wiki.nixos.org/wiki/Accelerated_Video_Playback
hardware.intelgpu = {
vaapiDriver = "intel-vaapi-driver";
enableHybridCodec = true;
};
}
-1
View File
@@ -2,7 +2,6 @@
{
imports = [ ../. ];
config = {
hardware.intelgpu.driver = lib.mkIf (lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.8") "xe";
boot.kernelParams = lib.mkIf (config.hardware.intelgpu.driver == "i915") [ "i915.enable_guc=3" ];
hardware.intelgpu.vaapiDriver = "intel-media-driver";
};
-2
View File
@@ -3,6 +3,4 @@
{
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 = lib.mkDefault true;
}
+9 -2
View File
@@ -1,6 +1,13 @@
{
imports = [
../../common/cpu/intel
../../common/pc/laptop
../latitude/e7240/default.nix
];
warnings = [
''
DEPRECATED: Importing dell/e7240 is deprecated. Use dell/latitude/e7240 instead.
This module will be removed in a future release.
''
];
}
+32
View File
@@ -0,0 +1,32 @@
{ lib, ... }:
{
imports = [
../../../common/cpu/intel/coffee-lake
../../../common/gpu/nvidia/prime.nix
../../../common/gpu/nvidia/pascal
../../../common/pc/laptop
../../../common/pc/laptop/ssd
];
# Specify bus id of Nvidia and Intel graphics
hardware.nvidia.prime = {
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
# Cooling management
services.thermald.enable = lib.mkDefault true;
boot = {
# Use same ACPI identifier as Dell Ubuntu
kernelParams = [ "acpi_osi=Linux-Dell-Video" ];
# Enable fan sensors.
kernelModules = [ "dell-smm-hwmon" ];
# Forces the driver to load on unknown hardware
extraModprobeConfig = "options dell-smm-hwmon ignore_dmi=1";
# NOTE: PWM fan control compatibility needs explicit whitelisting in the kernel driver's code.
};
}
+35
View File
@@ -0,0 +1,35 @@
## Dell Inspiron 3442
### Tested Hardware
```shellsession
$ lspci -nn
00:00.0 Host bridge [0600]: Intel Corporation Haswell-ULT DRAM Controller [8086:0a04] (rev 0b)
00:02.0 VGA compatible controller [0300]: Intel Corporation Haswell-ULT Integrated Graphics Controller [8086:0a16] (rev 0b)
00:03.0 Audio device [0403]: Intel Corporation Haswell-ULT HD Audio Controller [8086:0a0c] (rev 0b)
00:14.0 USB controller [0c03]: Intel Corporation 8 Series USB xHCI HC [8086:9c31] (rev 04)
00:16.0 Communication controller [0780]: Intel Corporation 8 Series HECI #0 [8086:9c3a] (rev 04)
00:1b.0 Audio device [0403]: Intel Corporation 8 Series HD Audio Controller [8086:9c20] (rev 04)
00:1c.0 PCI bridge [0604]: Intel Corporation 8 Series PCI Express Root Port 1 [8086:9c10] (rev e4)
00:1c.2 PCI bridge [0604]: Intel Corporation 8 Series PCI Express Root Port 3 [8086:9c14] (rev e4)
00:1c.3 PCI bridge [0604]: Intel Corporation 8 Series PCI Express Root Port 4 [8086:9c16] (rev e4)
00:1d.0 USB controller [0c03]: Intel Corporation 8 Series USB EHCI #1 [8086:9c26] (rev 04)
00:1f.0 ISA bridge [0601]: Intel Corporation 8 Series LPC Controller [8086:9c45] (rev 04)
00:1f.2 SATA controller [0106]: Intel Corporation 8 Series SATA Controller 1 [AHCI mode] [8086:9c03] (rev 04)
00:1f.3 SMBus [0c05]: Intel Corporation 8 Series SMBus Controller [8086:9c22] (rev 04)
06:00.0 Network controller [0280]: Broadcom Inc. and subsidiaries BCM43142 802.11b/g/n [14e4:4365] (rev 01)
07:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL810xE PCI Express Fast Ethernet controller [10ec:8136] (rev 07)
```
### Extra Configuration
#### Bluetooth
To enable bluetooth support, set `hardware.bluetooth.enable = true;`.
### Firmware Upgrades
This device is partially supported by [fwupd](https://fwupd.org).
Use `fwupdmgr` to perform updates.
+22
View File
@@ -0,0 +1,22 @@
{ config, lib, ... }:
{
imports = [
../../../common/cpu/intel
../../../common/pc/laptop
../../../common/gpu/intel/haswell
];
hardware.enableAllFirmware = lib.mkDefault true;
services = {
fwupd.enable = lib.mkDefault true;
thermald.enable = lib.mkDefault true;
};
boot = {
# needs to be explicitly loaded or else bluetooth/wifi won't work.
kernelModules = [ "wl" ];
extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ];
};
}
+58
View File
@@ -0,0 +1,58 @@
## Dell Inspiron 7559
### Tested Hardware
```shellsession
$ lspci -nn
00:00.0 Host bridge [0600]: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers [8086:1910] (rev 07)
00:01.0 PCI bridge [0604]: Intel Corporation 6th-10th Gen Core Processor PCIe Controller (x16) [8086:1901] (rev 07)
00:01.1 PCI bridge [0604]: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x8) [8086:1905] (rev 07)
00:02.0 VGA compatible controller [0300]: Intel Corporation HD Graphics 530 [8086:191b] (rev 06)
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 07)
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:16.0 Communication controller [0780]: Intel Corporation 100 Series/C230 Series Chipset Family MEI Controller #1 [8086:a13a] (rev 31)
00:17.0 SATA controller [0106]: Intel Corporation HM170/QM170 Chipset SATA Controller [AHCI Mode] [8086:a103] (rev 31)
00:1c.0 PCI bridge [0604]: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #1 [8086:a110] (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:1c.5 PCI bridge [0604]: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #6 [8086:a115] (rev f1)
00:1c.6 PCI bridge [0604]: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #7 [8086:a116] (rev f1)
00:1f.0 ISA bridge [0601]: Intel Corporation HM170 Chipset LPC/eSPI Controller [8086:a14e] (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 100 Series/C230 Series Chipset Family HD Audio Controller [8086:a170] (rev 31)
00:1f.4 SMBus [0c05]: Intel Corporation 100 Series/C230 Series Chipset Family SMBus [8086:a123] (rev 31)
02:00.0 3D controller [0302]: NVIDIA Corporation GM107M [GeForce GTX 960M] [10de:139b] (rev a2)
04:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 10)
05:00.0 Network controller [0280]: Intel Corporation Wireless 3165 [8086:3165] (rev 79)
06:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS522A PCI Express Card Reader [10ec:522a] (rev 01)
```
### Extra Configuration
#### Bluetooth
To enable bluetooth support, set `hardware.bluetooth.enable = true;`.
#### Prime Offloading
This configuration uses Nvidia Prime offloading, which allows use of the `nvidia-offload` script for running commands on the dGPU. For example, you can instruct Steam to launch a game offloaded to the GPU by setting the launch options for that game to `nvidia-offload %command%`.
#### SSD
This laptop has an optional M.2 SSD slot, which isn't accounted for here. If you are using the SSD, you could look into implementing the options in [ssd](common/pc/laptop/ssd) manually. Some sources also say you should ensure your SATA Mode is set to AHCI in your BIOS for it to be detected, however I think this is a prerequisite to installing Linux on this laptop in the first place so you probably already have that set.
#### Subwoofer
Tested with the default PipeWire configuration on Plasma, the subwoofer appears to work depending on the device Profile in sound settings ("Analog Stereo Duplex" works best for me). I have had issues with it in the past on other distros, so if it's not working on your system you could try the solution in [this thread](https://bbs.archlinux.org/viewtopic.php?id=207222).
#### Other issues
There are plenty of documented bugs and threads around issues on Dell laptops like this. Some of them stem from using the nouveau drivers, but we're using the proprietary Nvidia drivers here. Some things to look into if you're experiencing issues:
* I/O is slow: `nouveau` could be added as a kernel blocklist item: searching this repo shows other laptops with this configuration
* Power drain while sleeping: add the following as boot.kernelParams: `"mem_sleep_default=deep"`
* Issues coming back from suspend (particularly if the previous kernelParam is applied): add the following as boot.kernelParams: `"acpi_rev_override=1"` `"acpi_osi=Linux"`
* I also spotted [one person recommending](https://connorkuehl.github.io/dell-inspiron-7559-linux-guide/) setting just `"acpi_osi="`. This article is quite old though and I haven't tested the difference.
* Brightness function keys don't work: add the following as boot.kernelParams: `"acpi_backlight=vendor"` or `"acpi_backlight=native"`
+24
View File
@@ -0,0 +1,24 @@
{ lib, ... }:
{
imports = [
../../../common/pc/laptop
../../../common/pc/laptop/hdd
../../../common/cpu/intel/skylake
../../../common/gpu/nvidia/maxwell
../../../common/gpu/nvidia/prime.nix
];
hardware = {
nvidia.prime = {
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:2:0:0";
};
enableRedistributableFirmware = lib.mkDefault true;
};
services = {
thermald.enable = lib.mkDefault true;
};
}
+1 -1
View File
@@ -12,7 +12,7 @@
boot = {
# Kernel Panic on suspend fix, taken from ArchLinux wiki.
kernelParams = "acpi_enforce_resources=lax i915.enable_dc=0";
kernelParams = [ "acpi_enforce_resources=lax" "i915.enable_dc=0" ];
# Audio Mute LED
extraModprobeConfig = ''
options snd-hda-intel model=mute-led-gpio
+9
View File
@@ -0,0 +1,9 @@
{ lib, ... }:
{
imports = [
../../../common/cpu/intel/tiger-lake
../../../common/pc/laptop
../../../common/pc/laptop/ssd
];
}
File renamed without changes.
+6
View File
@@ -0,0 +1,6 @@
{
imports = [
../../../common/cpu/intel
../../../common/pc/laptop
];
}
+3
View File
@@ -27,4 +27,7 @@
# enable cooling management, see NixOS/nixos-hardware#127
services.thermald.enable = lib.mkDefault true;
# fix laptop's screen flickering, see https://wiki.archlinux.org/title/Intel_graphics#Screen_flickering
boot.kernelParams = ["i915.enable_psr=0"];
}
+1 -1
View File
@@ -2,7 +2,7 @@
{
imports = [
../../../common/cpu/intel
../../../common/cpu/intel/lunar-lake
../../../common/pc/laptop
../../../common/pc/laptop/ssd
];
+20
View File
@@ -0,0 +1,20 @@
= Dell XPS 15 9530 =
== Tested Hardware ==
* CPU: 13th Gen Intel(R) Core(TM) i9-13900H
* RAM: 32 GB
* HDD: 1 TiB SSD (NVME)
* Screen: 15" 4k (3456 x 2160)
* Graphics: NVIDIA GeForce RTX 4070 Laptop GPU, with Intel Graphics too.
* Input: Touchscreen and trackpad.
== Notes ==
== NVIDIA Offload ==
In order to run a program on the NVIDIA gpu, you can use the `nvidia-offload` function, for example:
```
nvidia-offload `nix-shell -p glxinfo --run 'glxgears'`
```
This is a short bash script that sets the proper environment variables and calls your command.
+29
View File
@@ -0,0 +1,29 @@
{ lib, ... }:
{
imports = [
../../../common/cpu/intel
../../../common/pc/laptop
../../../common/pc/laptop/ssd
];
# This will save you money and possibly your life!
services.thermald.enable = lib.mkDefault true;
# 9530 wifi is:
# > lspci | grep i Network
# - 00:14.3 Network controller: Intel Corporation Raptor Lake PCH CNVi WiFi (rev 01)
# > sudo lspci -vv -s 00:14.3
# 00:14.3 Network controller: Intel Corporation Raptor Lake PCH CNVi WiFi (rev 01)
# Subsystem: Intel Corporation Wi-Fi 6E AX211 160MHz
#
# WiFi speed is slow and crashes by default (https://bugzilla.kernel.org/show_bug.cgi?id=213381)
# disable_11ax - required until ax driver support is fixed
# power_save - works well on this card
# boot.extraModprobeConfig = ''
# options iwlwifi power_save=1 disable_11ax=1
# '';
boot.extraModprobeConfig = ''
options iwlwifi power_save=1
'';
}
+15
View File
@@ -0,0 +1,15 @@
{ lib, ... }:
{
imports = [
../default.nix
../../../../common/gpu/nvidia/prime.nix
];
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";
};
}
+1 -6
View File
@@ -1,11 +1,6 @@
{ lib, ... }:
{
imports = [
../../../common/cpu/intel/kaby-lake
../../../common/pc/laptop
./xps-common.nix
./shared.nix
];
# Includes the Wi-Fi and Bluetooth firmware
hardware.enableRedistributableFirmware = lib.mkDefault true;
}
+3 -3
View File
@@ -1,8 +1,8 @@
{
imports = [
../../../../common/cpu/intel
../../../../common/pc/laptop
../../../../common/gpu/nvidia/disable.nix
../xps-common.nix
../shared.nix
];
# Disables the Nvidia GPU, better for battery life
}
+1 -4
View File
@@ -1,12 +1,9 @@
{ ... }:
{
imports = [
../../../../common/cpu/intel
../../../../common/gpu/nvidia/prime.nix
../../../../common/gpu/nvidia/pascal
../../../../common/pc/laptop
../xps-common.nix
../shared.nix
];
+20
View File
@@ -0,0 +1,20 @@
{ lib, ... }:
{
imports = [
../../../common/cpu/intel/coffee-lake
../../../common/pc/laptop
];
# Solution to rcu_sched freezing
boot.kernelParams = [ "acpi_rev_override" ];
# This will save you money and possibly your life!
# https://github.com/NixOS/nixos-hardware/pull/127
services.thermald.enable = lib.mkDefault true;
hardware.graphics = {
enable = lib.mkDefault true;
enable32Bit = lib.mkDefault true;
};
}
-10
View File
@@ -1,10 +0,0 @@
{ lib, ... }:
{
# Solution to rcu_sched freezing
boot.kernelParams = [ "acpi_rev_override" ];
boot.kernelModules = [ "kvm-intel" ];
# This will save you money and possibly your life!
services.thermald.enable = lib.mkDefault true;
}
+31 -1
View File
@@ -12,6 +12,7 @@
{
acer-aspire-4810t = import ./acer/aspire/4810t;
airis-n990 = import ./airis/n990;
aoostar-r1-n100 = import ./aoostar/r1/n100;
apple-imac-14-2 = import ./apple/imac/14-2;
apple-imac-18-2 = import ./apple/imac/18-2;
apple-macbook-air-3 = import ./apple/macbook-air/3;
@@ -31,8 +32,11 @@
asus-ally-rc71l = import ./asus/ally/rc71l;
asus-fx504gd = import ./asus/fx504gd;
asus-fx506hm = import ./asus/fx506hm;
asus-fa506ic = import ./asus/fa506ic;
asus-fa507nv = import ./asus/fa507nv;
asus-fa507rm = import ./asus/fa507rm;
asus-flow-gv302x-amdgpu = import ./asus/flow/gv302x/amdgpu;
asus-flow-gv302x-nvidia = import ./asus/flow/gv302x/nvidia;
asus-pro-ws-x570-ace = import ./asus/pro-ws-x570-ace;
asus-rog-strix-g513im = import ./asus/rog-strix/g513im;
asus-rog-strix-g713ie = import ./asus/rog-strix/g713ie;
@@ -52,21 +56,28 @@
beagleboard-pocketbeagle = import ./beagleboard/pocketbeagle;
chuwi-minibook-x = import ./chuwi/minibook-x;
deciso-dec = import ./deciso/dec;
dell-e7240 = import ./dell/e7240;
dell-e7240 =
deprecated "1326" "dell-e7240"
(import ./dell/e7240);
dell-g3-3779 = import ./dell/g3/3779;
dell-g3-3579 = import ./dell/g3/3579;
dell-inspiron-14-5420 = import ./dell/inspiron/14-5420;
dell-inspiron-5509 = import ./dell/inspiron/5509;
dell-inspiron-5515 = import ./dell/inspiron/5515;
dell-inspiron-7405 = import ./dell/inspiron/7405;
dell-inspiron-7460 = import ./dell/inspiron/7460;
dell-inspiron-7559 = import ./dell/inspiron/7559;
dell-latitude-3340 = import ./dell/latitude/3340;
dell-latitude-3480 = import ./dell/latitude/3480;
dell-latitude-5490 = import ./dell/latitude/5490;
dell-latitude-5520 = import ./dell/latitude/5520;
dell-latitude-7280 = import ./dell/latitude/7280;
dell-latitude-7390 = import ./dell/latitude/7390;
dell-latitude-7420 = import ./dell/latitude/7420;
dell-latitude-7430 = import ./dell/latitude/7430;
dell-latitude-7490 = import ./dell/latitude/7490;
dell-latitude-9430 = import ./dell/latitude/9430;
dell-latitude-e7240 = import ./dell/latitude/e7240;
dell-optiplex-3050 = import ./dell/optiplex/3050;
dell-poweredge-r7515 = import ./dell/poweredge/r7515;
dell-precision-3541 = import ./dell/precision/3541;
@@ -92,6 +103,8 @@
dell-xps-15-9510-nvidia = import ./dell/xps/15-9510/nvidia;
dell-xps-15-9520 = import ./dell/xps/15-9520;
dell-xps-15-9520-nvidia = import ./dell/xps/15-9520/nvidia;
dell-xps-15-9530 = import ./dell/xps/15-9530;
dell-xps-15-9530-nvidia = import ./dell/xps/15-9530/nvidia;
dell-xps-15-9550 = import ./dell/xps/15-9550;
dell-xps-15-9550-nvidia = import ./dell/xps/15-9550/nvidia;
dell-xps-15-9560 = import ./dell/xps/15-9560;
@@ -114,10 +127,12 @@
friendlyarm-nanopi-r5s = import ./friendlyarm/nanopi-r5s;
focus-m2-gen1 = import ./focus/m2/gen1;
gigabyte-b550 = import ./gigabyte/b550;
gigabyte-b650 = import ./gigabyte/b650;
google-pixelbook = import ./google/pixelbook;
gpd-micropc = import ./gpd/micropc;
gpd-p2-max = import ./gpd/p2-max;
gpd-pocket-3 = import ./gpd/pocket-3;
gpd-pocket-4 = import ./gpd/pocket-4;
gpd-win-2 = import ./gpd/win-2;
gpd-win-max-2-2023 = import ./gpd/win-max-2/2023;
gpd-win-mini-2024 = import ./gpd/win-mini/2024;
@@ -126,10 +141,12 @@
hp-elitebook-845g7 = import ./hp/elitebook/845/g7;
hp-elitebook-845g8 = import ./hp/elitebook/845/g8;
hp-elitebook-845g9 = import ./hp/elitebook/845/g9;
hp-probook-440G5 = import ./hp/probook/440G5;
hp-laptop-14s-dq2024nf = import ./hp/laptop/14s-dq2024nf;
huawei-machc-wa = import ./huawei/machc-wa;
hp-notebook-14-df0023 = import ./hp/notebook/14-df0023;
intel-nuc-8i7beh = import ./intel/nuc/8i7beh;
lenovo-ideacentre-k330 = import ./lenovo/ideacentre/k330;
lenovo-ideapad-15alc6 = import ./lenovo/ideapad/15alc6;
lenovo-ideapad-15arh05 = import ./lenovo/ideapad/15arh05;
lenovo-ideapad-15ach6 = import ./lenovo/ideapad/15ach6;
@@ -157,6 +174,7 @@
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-e15-intel = import ./lenovo/thinkpad/e15/intel;
lenovo-thinkpad-e470 = import ./lenovo/thinkpad/e470;
lenovo-thinkpad-e495 = import ./lenovo/thinkpad/e495;
lenovo-thinkpad-l13 = import ./lenovo/thinkpad/l13;
@@ -171,7 +189,9 @@
lenovo-thinkpad-p14s-amd-gen3 = import ./lenovo/thinkpad/p14s/amd/gen3;
lenovo-thinkpad-p14s-amd-gen4 = import ./lenovo/thinkpad/p14s/amd/gen4;
lenovo-thinkpad-p14s-intel-gen3 = import ./lenovo/thinkpad/p14s/intel/gen3;
lenovo-thinkpad-p14s-intel-gen5 = import ./lenovo/thinkpad/p14s/intel/gen5;
lenovo-thinkpad-p16s-amd-gen1 = import ./lenovo/thinkpad/p16s/amd/gen1;
lenovo-thinkpad-p16s-amd-gen2 = import ./lenovo/thinkpad/p16s/amd/gen2;
lenovo-thinkpad-p50 = import ./lenovo/thinkpad/p50;
lenovo-thinkpad-p51 = import ./lenovo/thinkpad/p51;
lenovo-thinkpad-p52 = import ./lenovo/thinkpad/p52;
@@ -198,6 +218,7 @@
lenovo-thinkpad-t480 = import ./lenovo/thinkpad/t480;
lenovo-thinkpad-t480s = import ./lenovo/thinkpad/t480s;
lenovo-thinkpad-t490 = import ./lenovo/thinkpad/t490;
lenovo-thinkpad-t490s = import ./lenovo/thinkpad/t490s;
lenovo-thinkpad-t495 = import ./lenovo/thinkpad/t495;
lenovo-thinkpad-t520 = import ./lenovo/thinkpad/t520;
lenovo-thinkpad-w520 = import ./lenovo/thinkpad/w520;
@@ -263,7 +284,9 @@
nxp-imx8qm-mek = import ./nxp/imx8qm-mek;
hardkernel-odroid-hc4 = import ./hardkernel/odroid-hc4;
hardkernel-odroid-h3 = import ./hardkernel/odroid-h3;
hardkernel-odroid-h4 = import ./hardkernel/odroid-h4;
omen-14-fb0798ng = import ./omen/14-fb0798ng;
omen-15-ce002ns = import ./omen/15-ce002ns;
omen-15-en0010ca = import ./omen/15-en0010ca;
omen-16-n0005ne = import ./omen/16-n0005ne;
omen-16-n0280nd = import ./omen/16-n0280nd;
@@ -283,8 +306,13 @@
raspberry-pi-3 = import ./raspberry-pi/3;
raspberry-pi-4 = import ./raspberry-pi/4;
raspberry-pi-5 = import ./raspberry-pi/5;
rock-4c-plus = import ./radxa/rock-4c-plus;
rock-5b = import ./radxa/rock-5b;
rock-pi-4 = import ./radxa/rock-pi-4;
rock-pi-e = import ./radxa/rock-pi-e;
kobol-helios4 = import ./kobol/helios4;
samsung-np900x3c = import ./samsung/np900x3c;
slimbook-hero-rpl-rtx = import ./slimbook/hero/rpl-rtx;
starfive-visionfive-v1 = import ./starfive/visionfive/v1;
starfive-visionfive-2 = import ./starfive/visionfive/v2;
starlabs-starlite-i5 = import ./starlabs/starlite/i5;
@@ -301,8 +329,10 @@
tuxedo-aura-15-gen1 = import ./tuxedo/aura/15/gen1;
tuxedo-infinitybook-v4 = import ./tuxedo/infinitybook/v4;
tuxedo-infinitybook-pro14-gen7 = import ./tuxedo/infinitybook/pro14/gen7;
tuxedo-infinitybook-pro14-gen9-intel = import ./tuxedo/infinitybook/pro14/gen9-intel;
tuxedo-pulse-14-gen3 = import ./tuxedo/pulse/14/gen3;
tuxedo-pulse-15-gen2 = import ./tuxedo/pulse/15/gen2;
xiaomi-redmibook-16-pro-2024 = import ./xiaomi/redmibook/16-pro-2024;
common-cpu-amd = import ./common/cpu/amd;
common-cpu-amd-pstate = import ./common/cpu/amd/pstate.nix;
-40
View File
@@ -27,43 +27,3 @@ As of firmware v03.03, a bug in the EC causes the system to wake if AC is connec
```
See [Framework AMD Ryzen 7040 Series lid wakeup behavior feedback](https://community.frame.work/t/tracking-framework-amd-ryzen-7040-series-lid-wakeup-behavior-feedback/39128/45).
## Getting the fingerprint sensor to work
The firmware on the fingerprint sensor needs a downgrade to make it work on Linux.
The process is documented [here](https://knowledgebase.frame.work/en_us/updating-fingerprint-reader-firmware-on-linux-for-13th-gen-and-amd-ryzen-7040-series-laptops-HJrvxv_za).
However on recent NixOS versions also fwupd can no longer update the firmware.
Using the following snippet allows to temporarly downgrade fwupd to an old-enough version:
```nix
{
services.fwupd.enable = true;
# we need fwupd 1.9.7 to downgrade the fingerprint sensor firmware
services.fwupd.package = (import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/bb2009ca185d97813e75736c2b8d1d8bb81bde05.tar.gz";
sha256 = "sha256:003qcrsq5g5lggfrpq31gcvj82lb065xvr7bpfa8ddsw8x4dnysk";
}) {
inherit (pkgs) system;
}).fwupd;
}
```
Afterwards the downgraded driver can be downloaded and installed like this:
```
wget https://github.com/FrameworkComputer/linux-docs/raw/main/goodix-moc-609c-v01000330.cab
sudo fwupdtool install --allow-reinstall --allow-older goodix-moc-609c-v01000330.cab
Loading… [ - ]/nix/store/1n2l5law9g3b77hcfyp50vrhhssbrj5g-glibc-2.37-8/lib/libc.so.6: version `GLIBC_2.38' not found (required by /nix/store/f55npw04a2s6xmrbx4jw12xq16b3avb8-gvfs-1.52.1/lib/gio/modules/libgvfsdbus.so)
Failed to load module: /nix/store/f55npw04a2s6xmrbx4jw12xq16b3avb8-gvfs-1.52.1/lib/gio/modules/libgvfsdbus.so
Loading… [ ]12:16:46.348 FuHistory schema version 9 is unknown
Writing… [************************************* ]12:16:57.055 FuEngine failed to update-cleanup after failed update: failed to get device before update cleanup: failed to wait for detach replug: device d432baa2162a32c1554ef24bd8281953b9d07c11 did not come back
failed to write: failed to reply: transfer timed out
```
The error message above is harmless. After a reboot, I was able to enroll my fingerprint like this:
```
sudo fprintd-enroll $USER
```
@@ -1,4 +1,4 @@
{ lib, pkgs, ... }:
{ config, lib, pkgs, ... }:
{
imports = [
@@ -9,4 +9,29 @@
# Need at least 6.9 to make suspend properly
# Specifically this patch: https://github.com/torvalds/linux/commit/073237281a508ac80ec025872ad7de50cfb5a28a
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.9") (lib.mkDefault pkgs.linuxPackages_latest);
# Intel NPU Driver
# https://discourse.nixos.org/t/new-installation-on-asus-zenbook-ux5406-intel-vpu-firmware-error-2/58732/2
hardware.firmware = lib.optionals (config.hardware.enableRedistributableFirmware) [
(
let
model = "37xx";
version = "0.0";
firmware = pkgs.fetchurl {
url = "https://github.com/intel/linux-npu-driver/raw/v1.13.0/firmware/bin/vpu_${model}_v${version}.bin";
hash = "sha256-Mpoeq8HrwChjtHALsss/7QsFtDYAoFNsnhllU0xp3os=";
};
in
pkgs.runCommand "intel-vpu-firmware-${model}-${version}" { } ''
mkdir -p "$out/lib/firmware/intel/vpu"
cp '${firmware}' "$out/lib/firmware/intel/vpu/vpu_${model}_v${version}.bin"
''
)
];
warnings = lib.mkIf (!config.hardware.enableRedistributableFirmware) [
''For Intel NPU support, set the option: hardware.enableRedistributableFirmware = true;''
];
}
+11
View File
@@ -51,6 +51,17 @@ For the Framework 13 laptops, there are common configuration modules available u
including some modules specific to AMD- or Intel-based laptops. By preference, there will already be a specialised
module for your model's configuration. Otherwise, it can be added alongside the existing modules.
## OS integration
`hardware.framework.enableKmod` enables the [community-created Framework kernel
module](https://github.com/DHowett/framework-laptop-kmod) which exposes EC functionality like battery charge limit,
privacy switches, and system LEDs as standard driver interfaces. This enables, for example, configuring the charge limit
using the KDE settings GUI. The option is enabled by default when NixOS `>= 24.05` and linux kernel version `>= 6.10`.
On AMD Framework 13 and 16, before kernel 6.10, additional kernel patches are required for the kernel module to function
properly. Manually setting `hardware.framework.enableKmod = true` will apply the patches, requiring a kernel
recompilation.
## Support Tools
### fw-ectool
+35 -9
View File
@@ -1,17 +1,43 @@
{ config, lib, ... }:
{
options.hardware.framework.enableKmod = lib.mkEnableOption
{ config, lib, pkgs, ... }:
let
kernel_version_compatible = lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.10";
in {
options.hardware.framework.enableKmod = (lib.mkEnableOption
"Enable the community created Framework kernel module that allows interacting with the embedded controller from sysfs."
// {
# Enable by default if on new enough version of NixOS
default = (lib.versionAtLeast (lib.versions.majorMinor lib.version) "24.05");
) // {
# enable by default on NixOS >= 24.05 and kernel >= 6.10
default = lib.and
(lib.versionAtLeast (lib.versions.majorMinor lib.version) "24.05")
kernel_version_compatible;
defaultText = "enabled by default on NixOS >= 24.05 and kernel >= 6.10";
};
config = lib.mkIf config.hardware.framework.enableKmod {
boot.extraModulePackages = with config.boot.kernelPackages; [
config.boot = lib.mkIf config.hardware.framework.enableKmod {
extraModulePackages = with config.boot.kernelPackages; [
framework-laptop-kmod
];
# https://github.com/DHowett/framework-laptop-kmod?tab=readme-ov-file#usage
boot.kernelModules = [ "cros_ec" "cros_ec_lpcs" ];
kernelModules = [ "cros_ec" "cros_ec_lpcs" ];
# add required patch if enabled on kernel <6.10
kernelPatches = lib.mkIf (!kernel_version_compatible) [
rec {
name = "platform/chrome: cros_ec_lpc: add support for AMD Framework Laptops";
msgid = "20240403004713.130365-1-dustin@howett.net";
version = "3";
hash = "sha256-aQSyys8CMzlj9EdNhg8vtp76fg1qEwUVeJL0E+8w5HU=";
patch = pkgs.runCommandLocal "patch-${msgid}" {
nativeBuildInputs = with pkgs; [ b4 git cacert ];
SSL_CERT_FILE = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
outputHash = hash;
} ''
export HOME="$TMP"
PYTHONHASHSEED=0 ${pkgs.b4}/bin/b4 -n am -C -T -v ${version} -o- "${msgid}" > "$out"
'';
}
];
};
}
+3 -2
View File
@@ -9,9 +9,10 @@ Symptoms:
- It goes into suspend, then seems to boot and hang. Sometimes it suspends successfully, but waking it from suspend puts it in the "zombie" state.
- By playing chicken with volatile storage and flicking the power switch on the back of power supply, you can sometimes get it to wake from suspend as the card un-powers before volatile storage does.
Fix: disable GPP0 and GPP8 (And, for some cards, potentially PTXH, I can't test) in /proc/acpi/wakeup
- To do this permanently, a systemd service is provided
This can be fixed by disabling GPP0 and GPP8 (And, for some cards, potentially PTXH, I can't test) in /proc/acpi/wakeup.
But because /proc/acpi/wakeup only supports toggling (not disabling) wakeups, we use a udev rule to disable wakeups for
the same device by PCI device ID instead.
## This affects at least:
- Gigabyte b550m-d3sh (my machine)
+11 -33
View File
@@ -1,35 +1,13 @@
{ pkgs, lib, ... } :
{
systemd.services.bugfixSuspend-GPP0 = {
enable = lib.mkDefault true;
description = "Fix crash on wakeup from suspend/hibernate (b550 bugfix)";
unitConfig = {
Type = "oneshot";
};
serviceConfig = {
User = "root"; # root may not be necessary
# check for gppN, disable if enabled
# lifted from https://www.reddit.com/r/gigabyte/comments/p5ewjn/comment/ksbm0mb/ /u/Demotay
ExecStart = "-${pkgs.bash}/bin/bash -c 'if grep 'GPP0' /proc/acpi/wakeup | grep -q 'enabled'; then echo 'GPP0' > /proc/acpi/wakeup; fi'";
RemainAfterExit = "yes"; # required to not toggle when `nixos-rebuild switch` is ran
};
wantedBy = ["multi-user.target"];
};
systemd.services.bugfixSuspend-GPP8 = {
enable = lib.mkDefault true;
description = "Fix crash on wakeup from suspend/hibernate (b550 bugfix)";
unitConfig = {
Type = "oneshot";
};
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'";
RemainAfterExit = "yes";
};
wantedBy = ["multi-user.target"];
};
# Work around an issue causing the system to unsuspend immediately after suspend
# and/or hang after suspend.
#
# See https://www.reddit.com/r/gigabyte/comments/p5ewjn/comment/ksbm0mb/ /u/Demotay
#
# Most suggestions elsewhere are to disable GPP0 and/or GPP8 using /proc/acpi/wakeup, but that is
# inconvenient because it toggles. This does essentially the same thing using udev, which can set
# the wakeup attribute to a specific value.
services.udev.extraRules = ''
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x1022", ATTR{device}=="0x1483", ATTR{power/wakeup}="disabled"
'';
}
-5
View File
@@ -6,8 +6,3 @@ bug where the PC will wakeup immediately after going into suspend.
## Affects at least
- Gigabyte B650M Aorus Elite AX (Rev. 1.3) (BIOS Version F32b)
- Can not be fixed by modifying enabled entries in /proc/acpi/wakeup.
Computer wakes up even if all enabled entries are disabled. Therefore, no
fix exist currently.
+6
View File
@@ -0,0 +1,6 @@
{
# see https://bbs.archlinux.org/viewtopic.php?pid=2227023
boot.kernelParams = [
"acpi_osi=\"!Windows 2015\""
];
}
+5
View File
@@ -0,0 +1,5 @@
{
imports = [
./b650-fix-suspend.nix
];
}
+34
View File
@@ -0,0 +1,34 @@
{ lib, pkgs, ... }:
let inherit (lib) mkIf mkDefault;
in
{
imports = [
../../common/pc/laptop
../../common/pc/laptop/ssd
../../common/cpu/amd
../../common/cpu/amd/pstate.nix
../../common/gpu/amd
../../common/hidpi.nix
];
boot = {
# As of kernel version 6.6.72, amdgpu throws a fatal error during init, resulting in a barely-working display
kernelPackages = mkIf (lib.versionOlder pkgs.linux.version "6.12") pkgs.linuxPackages_latest;
kernelParams = [
# The GPD Pocket 4 uses a tablet LTPS display, that is mounted rotated 90° counter-clockwise
"fbcon=rotate:1" "video=eDP-1:panel_orientation=right_side_up"
];
};
fonts.fontconfig = {
subpixel.rgba = "vbgr"; # Pixel order for rotated screen
# The display has √(2560² + 1600²) px / 8.8in ≃ 343 dpi
# Per the documentation, antialiasing, hinting, etc. have no visible effect at such high pixel densities anyhow.
hinting.enable = mkDefault false;
};
# More HiDPI settings
services.xserver.dpi = 343;
}
+3 -3
View File
@@ -7,13 +7,13 @@
stdenv.mkDerivation (finalAttr: {
pname = "bmi260";
version = "1.0.0";
version = "1.1.0";
src = fetchFromGitHub {
owner = "hhd-dev";
repo = finalAttr.pname;
rev = "v${finalAttr.version}";
hash = "sha256-EFous0pPpCuVoCsFz6/4NryQRSH9Jw9Qng+RY1hiX1c=";
hash = "sha256-So8rWDTXYsMUgLBU9WrJp47txA8dI98tcxXNy92AYgg=";
};
hardeningDisable = [ "pic" ];
@@ -38,6 +38,6 @@ stdenv.mkDerivation (finalAttr: {
gpl2Only
];
maintainers = with maintainers; [ Cryolitia ];
platforms = platforms.linux;
platforms = [ "x86_64-linux" ];
};
})
+5
View File
@@ -0,0 +1,5 @@
{
imports = [
../../common/cpu/intel/alder-lake
];
}
+16
View File
@@ -0,0 +1,16 @@
{ config, lib, ... }:
{
# https://www.intel.com/content/www/us/en/products/sku/124967/intel-core-i58250u-processor-6m-cache-up-to-3-40-ghz/specifications.html
# this one works: https://nixos.wiki/wiki/Accelerated_Video_Playback
imports = [
../../../common/cpu/intel/kaby-lake
../../../common/pc
../../../common/pc/laptop
../../../common/pc/laptop/ssd
];
config = {
services.thermald.enable = lib.mkDefault true;
};
}
+17
View File
@@ -0,0 +1,17 @@
# Lenovo IdeaCentre K330
The specific system I took for reference has the following hardware configuration:
- Intel Core i7 2600
- NVIDIA GeForce GT 545 [Latest supported (proprietary) driver (390.xx)](https://www.nvidia.com/en-us/drivers/details/196213/)
- Some SSD (originally had a Seagate Barracuda hard drive)
This hardware configuration was motivated by #1297
I recommend enabling xserver instead of trying to use Wayland. As documented in the above linked issue, using Wayland with this rather old hardware lead to the system freezing after a short time of operation.
```nix
{
services.xserver.enable = true;
}
```
+19
View File
@@ -0,0 +1,19 @@
{ config, lib, ... }:
{
imports = [
../../../common/cpu/intel
../../../common/gpu/nvidia # Is it possible/advisable to pin this to the 390.xx driver family in case the user wants to use non-free drivers?
../../../common/gpu/amd # The K330 could be bought with AMD GPUs but I don't have that configuration
../../../common/pc
];
# On my machine Wayland causes the desktop to freeze after a short time of operation
services.displayManager.sddm.wayland.enable = false;
# Should this be a conditional default in case plasma is activated?
# What if somebody installs both plasma AND another DE?
# The goal is to prefer x11 over wayland due to compatibility issues with the old hardware
services.displayManager.defaultSession = lib.mkIf config.services.xserver.desktopManager.plasma6.enable (lib.mkDefault "plasmax11");
}
+6
View File
@@ -9,6 +9,12 @@ When using more than one drive, the value of `hardware.nvidia.prime.amdgpuBusId`
Make sure you override this default in your personal configuration. For two drives, it should be `PCI:6:0:0`.
## Using and troubleshooting power profiles (hybrid-only)
Power profile support (cycled via Fn + Q) is provided by `nvidia-powerd`.
Should you encounter issues with the `nvidia-powerd` daemon,
override the value of `hardware.nvidia.dynamicBoost.enable` to `false` in your personal configuration (and consider creating an issue if one does not exist).
## Setup at the time of testing
```
$ nix-info -m
+1
View File
@@ -28,6 +28,7 @@
nvidia = {
modesetting.enable = lib.mkDefault true;
powerManagement.enable = lib.mkDefault true;
dynamicBoost.enable = lib.mkDefault true;
prime = {
amdgpuBusId = lib.mkDefault "PCI:5:0:0";
+45
View File
@@ -0,0 +1,45 @@
# Lenovo Thinkpad E15
This is tested on an [E15 Gen4](https://psref.lenovo.com/WDProduct/ThinkPad/ThinkPad_E15_Gen_4_Intel).
## Tested Hardware
```bash
lspci -nn
00:00.0 Host bridge [0600]: Intel Corporation Alder Lake-U15 Host and DRAM Controller [8086:4601] (rev 04)
00:02.0 VGA compatible controller [0300]: Intel Corporation Alder Lake-UP3 GT2 [Iris Xe Graphics] [8086:46a8] (rev 0c)
00:04.0 Signal processing controller [1180]: Intel Corporation Alder Lake Innovation Platform Framework Processor Participant [8086:461d] (rev 04)
00:06.0 PCI bridge [0604]: Intel Corporation 12th Gen Core Processor PCI Express x4 Controller #0 [8086:464d] (rev 04)
00:07.0 PCI bridge [0604]: Intel Corporation Alder Lake-P Thunderbolt 4 PCI Express Root Port #0 [8086:466e] (rev 04)
00:08.0 System peripheral [0880]: Intel Corporation 12th Gen Core Processor Gaussian & Neural Accelerator [8086:464f] (rev 04)
00:0a.0 Signal processing controller [1180]: Intel Corporation Platform Monitoring Technology [8086:467d] (rev 01)
00:0d.0 USB controller [0c03]: Intel Corporation Alder Lake-P Thunderbolt 4 USB Controller [8086:461e] (rev 04)
00:0d.2 USB controller [0c03]: Intel Corporation Alder Lake-P Thunderbolt 4 NHI #0 [8086:463e] (rev 04)
00:0d.3 USB controller [0c03]: Intel Corporation Alder Lake-P Thunderbolt 4 NHI #1 [8086:466d] (rev 04)
00:14.0 USB controller [0c03]: Intel Corporation Alder Lake PCH USB 3.2 xHCI Host Controller [8086:51ed] (rev 01)
00:14.2 RAM memory [0500]: Intel Corporation Alder Lake PCH Shared SRAM [8086:51ef] (rev 01)
00:14.3 Network controller [0280]: Intel Corporation Alder Lake-P PCH CNVi WiFi [8086:51f0] (rev 01)
00:15.0 Serial bus controller [0c80]: Intel Corporation Alder Lake PCH Serial IO I2C Controller #0 [8086:51e8] (rev 01)
00:15.2 Serial bus controller [0c80]: Intel Corporation Alder Lake PCH Serial IO I2C Controller #2 [8086:51ea] (rev 01)
00:16.0 Communication controller [0780]: Intel Corporation Alder Lake PCH HECI Controller [8086:51e0] (rev 01)
00:1f.0 ISA bridge [0601]: Intel Corporation Alder Lake PCH eSPI Controller [8086:5182] (rev 01)
00:1f.3 Multimedia audio controller [0401]: Intel Corporation Alder Lake PCH-P High Definition Audio Controller [8086:51c8] (rev 01)
00:1f.4 SMBus [0c05]: Intel Corporation Alder Lake PCH-P SMBus Host Controller [8086:51a3] (rev 01)
00:1f.5 Serial bus controller [0c80]: Intel Corporation Alder Lake-P PCH SPI Controller [8086:51a4] (rev 01)
00:1f.6 Ethernet controller [0200]: Intel Corporation Ethernet Connection (16) I219-V [8086:1a1f] (rev 01)
01:00.0 Non-Volatile memory controller [0108]: Sandisk Corp WD PC SN740 NVMe SSD 512GB (DRAM-less) [15b7:5016] (rev 01)
```
## Updating Firmware
First enable `fwupd` in your config
```nix
services.fwupd.enable = true;
```
Then run
```bash
$ fwupdmgr update
```
+15
View File
@@ -0,0 +1,15 @@
{ ... }:
{
imports = [
../.
../../../common/pc/laptop
../../../common/pc/laptop/ssd
];
boot.kernelParams = [
# Force use of the thinkpad_acpi driver for backlight control.
# This allows the backlight save/load systemd service to work.
"acpi_backlight=native"
];
}
+10
View File
@@ -0,0 +1,10 @@
{ lib, ... }:
{
imports = [
../.
../../../../common/cpu/intel/alder-lake
];
services.throttled.enable = lib.mkDefault true;
}
@@ -0,0 +1,19 @@
{ lib, pkgs, ... }:
{
imports = [
../.
../../../../../common/gpu/nvidia/prime.nix
../../../../../common/gpu/nvidia/turing
];
hardware = {
intelgpu.driver = "i915"; #xe driver may be used on newer kernels
nvidia = {
prime = {
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
};
};
}
+7
View File
@@ -0,0 +1,7 @@
{
imports = [
../.
../../../../common/cpu/amd
../../../../common/gpu/amd
];
}
@@ -0,0 +1,5 @@
{
imports = [
../.
];
}
+6
View File
@@ -0,0 +1,6 @@
{
imports = [
../.
../../../common/pc/laptop/ssd
];
}
+9
View File
@@ -0,0 +1,9 @@
{lib, ...}: {
imports = [
../../../common/cpu/intel
../../../common/pc/ssd
../.
];
services.throttled.enable = lib.mkDefault true;
}
+2
View File
@@ -5,4 +5,6 @@
];
services.xserver.wacom.enable = lib.mkDefault config.services.xserver.enable;
services.hardware.bolt.enable = lib.mkDefault true;
}
+12 -7
View File
@@ -1,4 +1,4 @@
{ pkgs, lib, ...}:
{ pkgs, lib, ... }:
{
imports = [
@@ -7,10 +7,15 @@
environment.etc."asound.conf".source = ./asound.conf;
networking.networkmanager.fccUnlockScripts = [
{
id = "2c7c:030a";
path = "${pkgs.modemmanager}/share/ModemManager/fcc-unlock.available.d/2c7c:030a";
}
];
networking =
let
fcc_unlock_script = rec {
id = "2c7c:030a";
path = "${pkgs.modemmanager}/share/ModemManager/fcc-unlock.available.d/${id}";
};
in
if lib.versionOlder lib.version "25.05pre" then
{ networkmanager.fccUnlockScripts = [ fcc_unlock_script ]; }
else
{ modemmanager.fccUnlockScripts = [ fcc_unlock_script ]; };
}
@@ -7,14 +7,14 @@ let
cfg = config.microsoft-surface;
version = "6.12.8";
version = "6.12.19";
kernelPatches = surfacePatches {
inherit version;
patchFn = ./patches.nix;
};
kernelPackages = linuxPackage {
inherit version kernelPatches;
sha256 = "sha256-IpHaBlygS3Fcie5QNirsPwIadBS8lj8bVnNmgsgSKXk=";
sha256 = "sha256-1zvwV77ARDSxadG2FkGTb30Ml865I6KB8y413U3MZTE=";
ignoreConfigErrors=true;
};
+48 -40
View File
@@ -1,49 +1,57 @@
{ pkgs, ... } @ args:
{ pkgs, ... }@args:
with pkgs;
buildLinux (args // rec {
version = "5.15.71";
buildLinux (
args
// rec {
version = "5.15.71";
# modDirVersion needs to be x.y.z, will automatically add .0 if needed
modDirVersion = version;
# modDirVersion needs to be x.y.z, will automatically add .0 if needed
modDirVersion = version;
defconfig = "imx_v8_defconfig";
defconfig = "imx_v8_defconfig";
kernelPatches = [
];
# https://github.com/NixOS/nixpkgs/pull/366004
# introduced a breaking change that if a module is declared but it is not being used it will fail.
ignoreConfigErrors = true;
autoModules = false;
kernelPatches = [
];
extraConfig = ''
CRYPTO_TLS m
TLS y
MD_RAID0 m
MD_RAID1 m
MD_RAID10 m
MD_RAID456 m
DM_VERITY m
LOGO y
FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER n
FB_EFI n
EFI_STUB y
EFI y
VIRTIO y
VIRTIO_PCI y
VIRTIO_BLK y
DRM_VIRTIO_GPU y
EXT4_FS y
USBIP_CORE m
USBIP_VHCI_HCD m
USBIP_HOST m
USBIP_VUDC m
'';
autoModules = false;
src = fetchFromGitHub {
owner = "nxp-imx";
repo = "linux-imx";
# tag: refs/tags/lf-5.15.71-2.2.0
rev = "3313732e9984cb8a6b10a9085c7e18d58e770d56";
sha256 = "sha256-PBRiSgjPOq4keiwPOfNOswf1Zzdbn6YOjpOgv4/Oscc=";
};
} // (args.argsOverride or { }))
extraConfig = ''
CRYPTO_TLS m
TLS y
MD_RAID0 m
MD_RAID1 m
MD_RAID10 m
MD_RAID456 m
DM_VERITY m
LOGO y
FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER n
FB_EFI n
EFI_STUB y
EFI y
VIRTIO y
VIRTIO_PCI y
VIRTIO_BLK y
DRM_VIRTIO_GPU y
EXT4_FS y
USBIP_CORE m
USBIP_VHCI_HCD m
USBIP_HOST m
USBIP_VUDC m
'';
src = fetchFromGitHub {
owner = "nxp-imx";
repo = "linux-imx";
# tag: refs/tags/lf-5.15.71-2.2.0
rev = "3313732e9984cb8a6b10a9085c7e18d58e770d56";
sha256 = "sha256-PBRiSgjPOq4keiwPOfNOswf1Zzdbn6YOjpOgv4/Oscc=";
};
}
// (args.argsOverride or { })
)
+49 -43
View File
@@ -1,50 +1,56 @@
{pkgs, ...} @ args:
{ pkgs, ... }@args:
with pkgs;
buildLinux (args
// rec {
version = "6.1.55";
name = "imx8mp-linux";
buildLinux (
args
// rec {
version = "6.1.55";
name = "imx8mp-linux";
# modDirVersion needs to be x.y.z, will automatically add .0 if needed
modDirVersion = version;
# modDirVersion needs to be x.y.z, will automatically add .0 if needed
modDirVersion = version;
defconfig = "imx_v8_defconfig";
defconfig = "imx_v8_defconfig";
kernelPatches = [
];
# https://github.com/NixOS/nixpkgs/pull/366004
# introduced a breaking change that if a module is declared but it is not being used it will faill.
ignoreConfigErrors = true;
autoModules = false;
kernelPatches = [
];
extraConfig = ''
CRYPTO_TLS m
TLS y
MD_RAID0 m
MD_RAID1 m
MD_RAID10 m
MD_RAID456 m
DM_VERITY m
LOGO y
FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER n
FB_EFI n
EFI_STUB y
EFI y
VIRTIO y
VIRTIO_PCI y
VIRTIO_BLK y
DRM_VIRTIO_GPU y
EXT4_FS y
USBIP_CORE m
USBIP_VHCI_HCD m
USBIP_HOST m
USBIP_VUDC m
'';
autoModules = false;
src = fetchFromGitHub {
owner = "nxp-imx";
repo = "linux-imx";
# tag: lf-6.1.55-2.2.0
rev = "770c5fe2c1d1529fae21b7043911cd50c6cf087e";
sha256 = "sha256-tIWt75RUrjB6KmUuAYBVyAC1dmVGSUAgqV5ROJh3xU0=";
};
}
// (args.argsOverride or {}))
extraConfig = ''
CRYPTO_TLS m
TLS y
MD_RAID0 m
MD_RAID1 m
MD_RAID10 m
MD_RAID456 m
DM_VERITY m
LOGO y
FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER n
FB_EFI n
EFI_STUB y
EFI y
VIRTIO y
VIRTIO_PCI y
VIRTIO_BLK y
DRM_VIRTIO_GPU y
EXT4_FS y
USBIP_CORE m
USBIP_VHCI_HCD m
USBIP_HOST m
USBIP_VUDC m
'';
src = fetchFromGitHub {
owner = "nxp-imx";
repo = "linux-imx";
# tag: lf-6.1.55-2.2.0
rev = "770c5fe2c1d1529fae21b7043911cd50c6cf087e";
sha256 = "sha256-tIWt75RUrjB6KmUuAYBVyAC1dmVGSUAgqV5ROJh3xU0=";
};
}
// (args.argsOverride or { })
)
+4
View File
@@ -10,6 +10,10 @@ with pkgs;
defconfig = "imx_v8_defconfig";
# https://github.com/NixOS/nixpkgs/pull/366004
# introduced a breaking change that if a module is declared but it is not being used it will faill.
ignoreConfigErrors = true;
kernelPatches = [
];
+31
View File
@@ -0,0 +1,31 @@
# HP Omen 15-ce002ns
Profile for the following laptop: https://support.hp.com/us-en/document/c05552952
```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: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:16.0 Communication controller [0780]: Intel Corporation 100 Series/C230 Series Chipset Family MEI Controller #1 [8086:a13a] (rev 31)
00:17.0 SATA controller [0106]: Intel Corporation HM170/QM170 Chipset SATA Controller [AHCI Mode] [8086:a103] (rev 31)
00:1c.0 PCI bridge [0604]: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #1 [8086:a110] (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:1c.5 PCI bridge [0604]: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #6 [8086:a115] (rev f1)
00:1c.6 PCI bridge [0604]: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #7 [8086:a116] (rev f1)
00:1d.0 PCI bridge [0604]: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #9 [8086:a118] (rev f1)
00:1f.0 ISA bridge [0601]: Intel Corporation HM175 Chipset LPC/eSPI Controller [8086:a152] (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)
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP106BM [GeForce GTX 1060 Mobile 6GB] [10de:1c60] (rev a1)
01:00.1 Audio device [0403]: NVIDIA Corporation GP106 High Definition Audio Controller [10de:10f1] (rev a1)
3b:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 16)
3c:00.0 Network controller [0280]: Intel Corporation Wireless 7265 [8086:095a] (rev 61)
3d:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS522A PCI Express Card Reader [10ec:522a] (rev 01)
3e:00.0 Non-Volatile memory controller [0108]: Samsung Electronics Co Ltd NVMe SSD Controller SM961/PM961/SM963 [144d:a804]
```
+11
View File
@@ -0,0 +1,11 @@
{ lib, pkgs, ... }:
{
imports = [
../../common/cpu/intel/kaby-lake
../../common/gpu/nvidia/pascal
../../common/pc/laptop
../../common/pc/laptop/ssd
../../common/pc/laptop/hdd
];
}
@@ -0,0 +1,27 @@
--- orig.patch 2025-01-23 19:34:37.216154507 +0100
+++ updated-6.12.patch 2025-01-23 19:36:28.316333973 +0100
@@ -11,10 +11,10 @@
#define MT_QUIRK_NOT_SEEN_MEANS_UP BIT(0)
#define MT_QUIRK_SLOT_IS_CONTACTID BIT(1)
@@ -70,6 +73,7 @@
- #define MT_QUIRK_WIN8_PTP_BUTTONS BIT(18)
- #define MT_QUIRK_SEPARATE_APP_REPORT BIT(19)
#define MT_QUIRK_FORCE_MULTI_INPUT BIT(20)
-+#define MT_QUIRK_NON_MT_PEN BIT(21)
+ #define MT_QUIRK_DISABLE_WAKEUP BIT(21)
+ #define MT_QUIRK_ORIENTATION_INVERT BIT(22)
++#define MT_QUIRK_NON_MT_PEN BIT(23)
#define MT_INPUTMODE_TOUCHSCREEN 0x02
#define MT_INPUTMODE_TOUCHPAD 0x03
@@ -41,9 +41,9 @@
#define MT_CLS_RAZER_BLADE_STEALTH 0x0112
#define MT_CLS_SMART_TECH 0x0113
+#define MT_CLS_NON_MT_PEN 0x0114
+ #define MT_CLS_SIS 0x0457
#define MT_DEFAULT_MAXCONTACT 10
- #define MT_MAX_MAXCONTACT 250
@@ -374,6 +383,9 @@
MT_QUIRK_CONTACT_CNT_ACCURATE |
MT_QUIRK_SEPARATE_APP_REPORT,
@@ -18,8 +18,16 @@ let
cat ${patch1_original} > $out
${patch}/bin/patch $out < ${./6.1.patch.patch}
'';
patch1_updated_6_12 = runCommand
"goodix-stylus-mastykin-1-pen-support-6.12.patch" {}
''
cat ${patch1_original} > $out
${patch}/bin/patch $out < ${./6.12.patch.patch}
'';
patch1 =
if (lib.versionAtLeast kernel.version "6.1") then
if (lib.versionAtLeast kernel.version "6.12") then
patch1_updated_6_12
else if (lib.versionAtLeast kernel.version "6.1") then
patch1_updated_6_1
else if (lib.versionAtLeast kernel.version "5.12.12") then
patch1_updated_5_12_12
+8
View File
@@ -12,3 +12,11 @@ firmware.
Alternatively, starting from the _Tow-Boot_ disk image on eMMC is easier to
deal with and understand than having to deal with _U-Boot_ manually.
## Console
To configure default console I/O to use serial instead of HDMI (default):
```nix
hardware.rockpro64.console = "serial";
```
+17
View File
@@ -0,0 +1,17 @@
{ config, lib, ... }:
{
options.hardware.rockpro64.console = lib.mkOption {
default = "hdmi";
description = "Default console to use at boot.";
type = lib.types.enum [
"hdmi"
"serial"
];
};
config = lib.mkIf (config.hardware.rockpro64.console == "hdmi") {
boot.kernelParams = [
"console=ttyS0"
"console=tty0"
];
};
}
+7
View File
@@ -1,10 +1,17 @@
{ lib, ... }:
{
imports = [
./console.nix
];
boot.initrd.kernelModules = [
# PCIe/NVMe
"nvme"
"pcie_rockchip_host"
"phy_rockchip_pcie"
# Network
"dwmac_rk"
# HDMI
"rockchipdrm"
];
# control the fan on the rockpro64 (like the one in the NAS case)
hardware.fancontrol = {
+40 -17
View File
@@ -1,18 +1,41 @@
{ config, lib, pkgs, ... }:
{
config = lib.mkIf config.hardware.librem5.audio {
assertions = [{
assertion = config.hardware.pulseaudio.enable;
message = "Call audio on Librem5 requires pulse audio to be enabled through `hardware.pulseaudio.enable`.";
}];
hardware.pulseaudio = {
enable = true;
# this is required to correctly configure the modem as PA source/sink
extraConfig = ''
.include ${config.hardware.librem5.package}/etc/pulse/librem5.pa
'';
};
services.dbus.packages = [ pkgs.callaudiod ];
};
{ config
, lib
, pkgs
, ...
}: {
config =
lib.mkIf config.hardware.librem5.audio
{
services.dbus.packages = [ pkgs.callaudiod ];
}
// (
let
paConfig = {
enable = true;
# this is required to correctly configure the modem as PA source/sink
extraConfig = ''
.include ${config.hardware.librem5.package}/etc/pulse/librem5.pa
'';
};
in
if lib.versionOlder (lib.versions.majorMinor lib.version) "25.05"
then {
assertions = [
{
assertion = config.hardware.pulseaudio.enable;
message = "Call audio on Librem5 requires pulse audio to be enabled through `hardware.pulseaudio.enable`.";
}
];
hardware.pulseaudio = paConfig;
}
else {
assertions = [
{
assertion = config.services.pulseaudio.enable;
message = "Call audio on Librem5 requires pulse audio to be enabled through `services.pulseaudio.enable`.";
}
];
services.pulseaudio = paConfig;
}
);
}
+6 -3
View File
@@ -6,16 +6,19 @@
buildLinux (args
// rec {
defconfig = "librem5_defconfig";
version = "6.6.29-librem5";
version = "6.6.74-librem5";
modDirVersion = version;
src = fetchFromGitLab {
domain = "source.puri.sm";
owner = "Librem5";
repo = "linux";
rev = "pureos/6.6.29pureos1";
hash = "sha256-i8HSAJ1/Z2Ux2s3Srse+L0S1Zd/70ldpGBhIgEZ6nBw=";
rev = "pureos/6.6.74pureos1";
hash = "sha256-qUPY+2fHVu7SFc+Uf8U7QtkQJJsE/4I1SavpLqJ/34c=";
};
kernelPatches = [ ];
# see https://github.com/NixOS/nixpkgs/pull/366004
ignoreConfigErrors = true;
structuredExtraConfig = with lib.kernel; {
# buildLinux overrides this and defaults to 32, so go back to the value defined librem5_defconfig
# this is required for millipixels to take photos, otherwise the VIDIOC_REQ_BUFS ioctl returns ENOMEM
+112
View File
@@ -0,0 +1,112 @@
# NixOS support for Radxa devices
Radxa provides the NixOS implementation in the form of `nixos-hardware` modules
for advanced users.
Our goals are:
* Only use `nixpkgs` provided packages.
* Provide a consistent and simple experience to use our NixOS module.
* Targetted audiences are advanced users who care mostly about CPU compute, storage, and network.
* No support guarantee. We are not here to teach people how to use NixOS.
We explicitly want to avoid packaging the entire vendor SDK bootloader and kernel
in Nix. Those are not going to be accepted in `nixpkgs`, and our targetted audiences
like homelabbers generally ignore the additional hardware features.
This also aligns with [NixOS on ARM](https://wiki.nixos.org/wiki/NixOS_on_ARM)'s
definition of "support":
> Support for those board assumes as much is supported as Mainline Linux supports.
## Characteristic of the default profiles
* Using `linuxPackages_latest`
* `bcachefs` rootfs with zstd compression and password-less encryption enabled
* EFI boot chain provided by `systemd-boot`
* Default serial console enabled with baud rate matches the platform firmware
* No automatic partition expansion, as the module is only focusing on hardware
## Common Nix flake pattern
Below is an annoated flake example to create the initial boot image.
```
{
description = "Example NixOS configurations for Radxa product";
# To build, run `nix build .#nixosConfigurations.radxa.config.system.build.diskoImages`
inputs = {
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
nixos-hardware.url = "github:NixOS/nixos-hardware";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
nixpkgs-unfree.url = "github:numtide/nixpkgs-unfree/nixos-unstable";
};
outputs = inputs@{
self,
disko,
nixos-hardware,
nixpkgs,
nixpkgs-unfree,
}: {
nixosConfigurations = {
radxa = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
system = "aarch64-linux";
modules = [
nixos-hardware.nixosModules.rock-4c-plus # Update the system according to your device.
# Or, if the default platform firmware is not available in the NixOS version you are using:
# (import nixos-hardware.nixosModules.rock-pi-e {
# lib = nixpkgs-unfree.lib;
# config = nixpkgs-unfree.config;
# pkgs = nixpkgs-unfree.legacyPackages.aarch64-linux;
# })
disko.nixosModules.disko # disko usage is optional in the running system, but we need it to generate the initial boot image.
"${nixos-hardware}/radxa/disko.nix" # Common Radxa Disko profile. It is system-agnostic.
{
disko = {
imageBuilder = {
# Avoid double emulation to significantly speed up image building process.
# Update the system according to your host system.
# See https://github.com/nix-community/disko/issues/856
qemu = nixpkgs.legacyPackages.x86_64-linux.qemu + "/bin/qemu-system-aarch64 -M virt -cpu cortex-a57";
};
# Default image size is 2G for a small basic CLI system.
# devices.disk.main.imageSize = "2G";
};
# Override the default bootloader with a cross built one.
# Use this if you do not have binfmt configured on your system.
# For NixOS, please add `boot.binfmt.emulatedSystems = [ "aarch64-linux" ];` to your system configuration.
# Read the device module to see how it was configured.
# hardware.rockchip.platformFirmware = nixpkgs-unfree.legacyPackages.x86_64-linux.pkgsCross.aarch64-multiplatform.ubootRock4CPlus;
users.users.radxa = {
isNormalUser = true;
initialPassword = "radxa";
extraGroups = [ "wheel" ];
};
services.openssh.enable = true;
networking.hostName = "radxa";
system.stateVersion = "24.11";
}
];
};
};
};
}
```
For most of the supported products, you only need to change the device module (
i.e. `nixos-hardware.nixosModules.rock-4c-plus`) to match the one you are using.
## Known issues
* Currently, the `hardware.radxa` module and Radxa-maintained SoC vendor modules
(eg. `hardware.rockchip`) are tightly coupled and not intended for end-user to
use. Those options are currently used internally for hardware enablement, and
end-user should not need to modify them. Consider those interfaces **unstable**.
+23
View File
@@ -0,0 +1,23 @@
{ lib
, pkgs
, config
, ...
}:
let
cfg = config.hardware.radxa;
in {
options.hardware.radxa = {
enable = lib.mkEnableOption "Radxa system support";
};
config = lib.mkIf cfg.enable {
boot = {
# Currently enable bcachefs automatically set
# kernelPackages = lib.mkDefault pkgs.linuxPackages_latest;
# TODO: Consider removing this line once, we get an LTS kernel that is newer than 6.12
kernelPackages = lib.mkOverride 990 pkgs.linuxPackages_latest;
supportedFilesystems = [ "bcachefs" ];
loader.systemd-boot.enable = lib.mkDefault true;
};
};
}
+12
View File
@@ -0,0 +1,12 @@
{ lib
, pkgs
, config
, ...
}:
let
cfg = config.hardware.radxa;
in {
imports = [
../rockchip/disko.nix
];
}
+20
View File
@@ -0,0 +1,20 @@
{ lib
, pkgs
, config
, ...
}: {
imports = [
../.
../../rockchip
];
config = {
hardware = {
radxa.enable = true;
rockchip = {
rk3399.enable = true;
platformFirmware = lib.mkDefault pkgs.ubootRock4CPlus;
};
};
};
}
+20
View File
@@ -0,0 +1,20 @@
{ lib
, pkgs
, config
, ...
}: {
imports = [
../.
../../rockchip
];
config = {
hardware = {
radxa.enable = true;
rockchip = {
rk3588.enable = true;
platformFirmware = lib.mkDefault pkgs.ubootRock5ModelB;
};
};
};
}
+20
View File
@@ -0,0 +1,20 @@
{ lib
, pkgs
, config
, ...
}: {
imports = [
../.
../../rockchip
];
config = {
hardware = {
radxa.enable = true;
rockchip = {
rk3399.enable = true;
platformFirmware = lib.mkDefault pkgs.ubootRockPi4;
};
};
};
}
+20
View File
@@ -0,0 +1,20 @@
{ lib
, pkgs
, config
, ...
}: {
imports = [
../.
../../rockchip
];
config = {
hardware = {
radxa.enable = true;
rockchip = {
rk3328.enable = true;
platformFirmware = lib.mkDefault pkgs.ubootRockPiE;
};
};
};
}
+1 -4
View File
@@ -13,10 +13,7 @@
loader = {
grub.enable = lib.mkDefault false;
generationsDir.enable = lib.mkDefault false;
raspberryPi = {
enable = lib.mkDefault true;
version = lib.mkDefault 2;
};
generic-extlinux-compatible.enable = lib.mkDefault true;
};
};
+2 -2
View File
@@ -18,7 +18,7 @@ in {
hardware.deviceTree = {
overlays = [
# Equivalent to: https://github.com/raspberrypi/linux/blob/rpi-6.1.y/arch/arm/boot/dts/overlays/rpi-poe-overlay.dts
# Equivalent to: https://github.com/raspberrypi/linux/blob/rpi-6.6.y/arch/arm/boot/dts/overlays/rpi-poe-overlay.dts
{
name = "rpi-poe-overlay";
dtsText = ''
@@ -38,7 +38,7 @@ in {
compatible = "pwm-fan";
cooling-levels = <0 1 10 100 255>;
#cooling-cells = <2>;
pwms = <&fwpwm 0 80000>;
pwms = <&fwpwm 0 80000 0>;
};
};
};
+3 -3
View File
@@ -19,8 +19,8 @@ in {
hardware.deviceTree = {
overlays = [
# Combined equivalent to:
# * https://github.com/raspberrypi/linux/blob/rpi-6.1.y/arch/arm/boot/dts/overlays/rpi-poe-overlay.dts
# * https://github.com/raspberrypi/linux/blob/rpi-6.1.y/arch/arm/boot/dts/overlays/rpi-poe-plus-overlay.dts
# * https://github.com/raspberrypi/linux/blob/rpi-6.6.y/arch/arm/boot/dts/overlays/rpi-poe-overlay.dts
# * https://github.com/raspberrypi/linux/blob/rpi-6.6.y/arch/arm/boot/dts/overlays/rpi-poe-plus-overlay.dts
{
name = "rpi-poe-plus-overlay";
dtsText = ''
@@ -40,7 +40,7 @@ in {
compatible = "pwm-fan";
cooling-levels = <0 1 10 100 255>;
#cooling-cells = <2>;
pwms = <&fwpwm 0 80000>;
pwms = <&fwpwm 0 80000 0>;
};
};
};
+53
View File
@@ -0,0 +1,53 @@
{ lib
, pkgs
, config
, ...
}:
let
cfg = config.hardware.rockchip;
in {
imports = [
./rk3328
./rk3399
./rk3588
];
options.hardware.rockchip = {
enable = lib.mkEnableOption "Rockchip SoC support";
diskoImageName = lib.mkOption {
type = lib.types.str;
default = "main.raw";
description = ''
The output image name of Disko.
You need to match this value with the real image name. Setting it alone
won't change the output image name, as it is controlled by Disko module.
Can be used in diskoExtraPostVM.
'';
};
platformFirmware = lib.mkPackageOption pkgs "platform firmware" {
default = null;
};
diskoExtraPostVM = lib.mkOption {
type = lib.types.str;
default = ''
${lib.getExe' pkgs.coreutils "dd"} conv=notrunc,fsync if=${config.hardware.rockchip.platformFirmware}/idbloader.img of=$out/${config.hardware.rockchip.diskoImageName} bs=512 seek=64
${lib.getExe' pkgs.coreutils "dd"} conv=notrunc,fsync if=${config.hardware.rockchip.platformFirmware}/u-boot.itb of=$out/${config.hardware.rockchip.diskoImageName} bs=512 seek=16384
'';
defaultText = lib.literalExpression ''
${lib.getExe' pkgs.coreutils "dd"} conv=notrunc,fsync if=${config.hardware.rockchip.platformFirmware}/idbloader.img of=$out/${config.hardware.rockchip.diskoImageName} bs=512 seek=64
${lib.getExe' pkgs.coreutils "dd"} conv=notrunc,fsync if=${config.hardware.rockchip.platformFirmware}/u-boot.itb of=$out/${config.hardware.rockchip.diskoImageName} bs=512 seek=16384
'';
description = ''
The post VM hook for Disko's Image Builder.
Can be used to install platform firmware like U-Boot.
'';
};
};
config = lib.mkIf cfg.enable {
boot = {
kernelParams = [ "console=ttyS2,1500000n8" ];
};
};
}
+62
View File
@@ -0,0 +1,62 @@
{ lib
, pkgs
, config
, ...
}:
let
cfg = config.hardware.rockchip;
in {
imports = [
rk3399/disko.nix
];
config = lib.mkIf cfg.enable {
disko = {
imageBuilder = {
extraRootModules = [ "bcachefs" ];
extraPostVM = cfg.diskoExtraPostVM;
};
memSize = lib.mkDefault 4096; # Default 1024 MB will throw "Cannot allocate memory" error
devices.disk.main = {
type = "disk";
imageSize = lib.mkDefault "2G";
content = {
type = "gpt";
partitions = {
ESP = {
type = "EF00";
# Firmware backoff
start = "16M";
size = "500M";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0022" ];
};
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "bcachefs";
mountpoint = "/";
extraArgs = [
"--metadata_checksum=xxhash"
"--data_checksum=xxhash"
"--compression=zstd"
"--background_compression=zstd"
"--str_hash=siphash"
"--wide_macs"
"--encrypted"
"--no_passphrase"
"--discard"
];
};
};
};
};
};
};
};
}
Loaded 100 of 115 files, more files were not shown because too many files have changed in this diff. Show more