mirror of
https://github.com/NixOS/nixos-hardware.git
synced 2026-11-30 21:13:30 +01:00
Compare commits
81
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
92e7eb27a6 | ||
|
|
daaae13dff | ||
|
|
4f4d97d7b7 | ||
|
|
36d0027ef4 | ||
|
|
e8c83f0759 | ||
|
|
fad7119291 | ||
|
|
05fa89d1c5 | ||
|
|
113cd39166 | ||
|
|
3970af5d58 | ||
|
|
e1f1215125 | ||
|
|
09e97074ad | ||
|
|
1b1acdc3e7 | ||
|
|
de70a293ae | ||
|
|
b416c1d56f | ||
|
|
59314eb9f5 | ||
|
|
14f45c1a63 | ||
|
|
d25dac1bd5 | ||
|
|
b48cc4dab0 | ||
|
|
ae546d018a | ||
|
|
71ab5581a0 | ||
|
|
5335d4303b | ||
|
|
52cfc084ef | ||
|
|
d23a3bc3c6 | ||
|
|
009b764ac9 | ||
|
|
d58f642ddb | ||
|
|
55e9685ec6 | ||
|
|
bbf25ca940 | ||
|
|
9430c63e02 | ||
|
|
76a98e3958 | ||
|
|
9d5dedae84 | ||
|
|
0b2e2fe9b3 | ||
|
|
ab84bd93a3 | ||
|
|
28f2a7454f | ||
|
|
79bc209be8 | ||
|
|
80340dcf86 | ||
|
|
099d38a69e | ||
|
|
71cca26f33 | ||
|
|
8f44cbb48c | ||
|
|
fb12c8270a | ||
|
|
cda8312060 | ||
|
|
a0252d668c | ||
|
|
d098b09500 | ||
|
|
04be27ce49 | ||
|
|
9b49e20140 | ||
|
|
f75203cc31 | ||
|
|
d2483459e8 | ||
|
|
18e9f9753e | ||
|
|
3e2ea8a49d | ||
|
|
08c94a8b62 | ||
|
|
e47365f377 | ||
|
|
ba37846397 | ||
|
|
4f90da509b | ||
|
|
2eccff41ba | ||
|
|
d1f201fc62 | ||
|
|
68cc7a876b | ||
|
|
52047449bf | ||
|
|
c5666d9cd6 | ||
|
|
d85ec4b3c6 | ||
|
|
240f698fc8 | ||
|
|
d9819a6791 | ||
|
|
da7014af5d | ||
|
|
9bdd53f590 | ||
|
|
537286c3c5 | ||
|
|
b8be6f78b0 | ||
|
|
34b64e4e1d | ||
|
|
21fa58535d | ||
|
|
95c8efc0cb | ||
|
|
3009bcb058 | ||
|
|
dfad538f75 | ||
|
|
7659093598 | ||
|
|
c2aa5756c0 | ||
|
|
3a123626d9 | ||
|
|
cbefe8bde7 | ||
|
|
9368027715 | ||
|
|
6209032a7c | ||
|
|
5f052b2663 | ||
|
|
63c0f02ce5 | ||
|
|
8b5ef47338 | ||
|
|
61c79181e7 | ||
|
|
b539957839 | ||
|
|
1f23785afe |
No files matched your search
@@ -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 .
|
||||
@@ -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
|
||||
|
||||
@@ -91,6 +91,7 @@ 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>` |
|
||||
@@ -118,20 +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>` |
|
||||
@@ -156,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>` |
|
||||
@@ -167,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>` |
|
||||
@@ -178,6 +185,7 @@ 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>` |
|
||||
@@ -191,8 +199,9 @@ 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>` |
|
||||
@@ -222,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>` |
|
||||
@@ -235,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>` |
|
||||
@@ -263,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>` |
|
||||
@@ -299,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>` |
|
||||
@@ -320,6 +333,7 @@ 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>` |
|
||||
@@ -337,6 +351,10 @@ 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>` |
|
||||
@@ -358,6 +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>` |
|
||||
@@ -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
@@ -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
@@ -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; })
|
||||
];
|
||||
})
|
||||
];
|
||||
}
|
||||
@@ -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;
|
||||
};
|
||||
}
|
||||
@@ -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 {}))
|
||||
@@ -0,0 +1,6 @@
|
||||
{ callPackage, linux_6_12, ... }@args:
|
||||
|
||||
callPackage ./generic.nix args {
|
||||
kernel = linux_6_12;
|
||||
patchesFile = ./stable.json;
|
||||
}
|
||||
@@ -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 { })
|
||||
)
|
||||
@@ -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="
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{ callPackage, linux_6_13, ... }@args:
|
||||
|
||||
callPackage ./generic.nix args {
|
||||
kernel = linux_6_13;
|
||||
patchesFile = ./latest.json;
|
||||
}
|
||||
@@ -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="
|
||||
}
|
||||
]
|
||||
}
|
||||
Executable
+93
@@ -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())
|
||||
@@ -30,9 +30,6 @@ in {
|
||||
amdgpu.initrd.enable = mkDefault true;
|
||||
|
||||
nvidia = {
|
||||
|
||||
#to avoid problems with gnome 47 vulkan
|
||||
package = mkDefault config.boot.kernelPackages.nvidiaPackages.beta;
|
||||
|
||||
modesetting.enable = true;
|
||||
nvidiaSettings = mkDefault true;
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
imports = [
|
||||
../cpu-only.nix
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
imports = [
|
||||
./cpu-only.nix
|
||||
../../../gpu/intel/skylake
|
||||
];
|
||||
}
|
||||
@@ -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;
|
||||
};
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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.
|
||||
''
|
||||
];
|
||||
}
|
||||
@@ -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.
|
||||
};
|
||||
}
|
||||
@@ -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.
|
||||
@@ -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 ];
|
||||
};
|
||||
}
|
||||
@@ -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"`
|
||||
@@ -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;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{ lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
../../../common/cpu/intel/tiger-lake
|
||||
../../../common/pc/laptop
|
||||
../../../common/pc/laptop/ssd
|
||||
];
|
||||
}
|
||||
File renamed without changes.
@@ -0,0 +1,6 @@
|
||||
{
|
||||
imports = [
|
||||
../../../common/cpu/intel
|
||||
../../../common/pc/laptop
|
||||
];
|
||||
}
|
||||
@@ -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"];
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
{
|
||||
imports = [
|
||||
../../../common/cpu/intel
|
||||
../../../common/cpu/intel/lunar-lake
|
||||
../../../common/pc/laptop
|
||||
../../../common/pc/laptop/ssd
|
||||
];
|
||||
|
||||
@@ -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.
|
||||
@@ -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
|
||||
'';
|
||||
}
|
||||
@@ -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,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;
|
||||
}
|
||||
@@ -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,12 +1,9 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
../../../../common/cpu/intel
|
||||
../../../../common/gpu/nvidia/prime.nix
|
||||
../../../../common/gpu/nvidia/pascal
|
||||
../../../../common/pc/laptop
|
||||
../xps-common.nix
|
||||
../shared.nix
|
||||
];
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
@@ -55,22 +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;
|
||||
@@ -96,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;
|
||||
@@ -118,6 +127,7 @@
|
||||
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;
|
||||
@@ -131,6 +141,7 @@
|
||||
hp-elitebook-845g7 = import ./hp/elitebook/845/g7;
|
||||
hp-elitebook-845g8 = import ./hp/elitebook/845/g8;
|
||||
hp-elitebook-845g9 = import ./hp/elitebook/845/g9;
|
||||
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;
|
||||
@@ -163,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;
|
||||
@@ -177,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;
|
||||
@@ -204,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;
|
||||
@@ -269,6 +284,7 @@
|
||||
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;
|
||||
@@ -290,6 +306,10 @@
|
||||
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;
|
||||
@@ -309,6 +329,7 @@
|
||||
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;
|
||||
|
||||
@@ -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;''
|
||||
];
|
||||
|
||||
}
|
||||
@@ -9,6 +9,7 @@ in {
|
||||
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";
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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"
|
||||
'';
|
||||
}
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
# see https://bbs.archlinux.org/viewtopic.php?pid=2227023
|
||||
boot.kernelParams = [
|
||||
"acpi_osi=\"!Windows 2015\""
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
imports = [
|
||||
./b650-fix-suspend.nix
|
||||
];
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
{ lib, pkgs, ... }:
|
||||
let inherit (lib) mkDefault;
|
||||
let inherit (lib) mkIf mkDefault;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
@@ -11,10 +11,15 @@ in
|
||||
../../common/hidpi.nix
|
||||
];
|
||||
|
||||
boot.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"
|
||||
];
|
||||
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
|
||||
|
||||
@@ -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" ];
|
||||
};
|
||||
})
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
imports = [
|
||||
../../common/cpu/intel/alder-lake
|
||||
];
|
||||
}
|
||||
@@ -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;
|
||||
};
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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
|
||||
```
|
||||
@@ -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"
|
||||
];
|
||||
}
|
||||
@@ -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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
imports = [
|
||||
../.
|
||||
../../../../common/cpu/amd
|
||||
../../../../common/gpu/amd
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
imports = [
|
||||
../.
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
imports = [
|
||||
../.
|
||||
../../../common/pc/laptop/ssd
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{lib, ...}: {
|
||||
imports = [
|
||||
../../../common/cpu/intel
|
||||
../../../common/pc/ssd
|
||||
../.
|
||||
];
|
||||
|
||||
services.throttled.enable = lib.mkDefault true;
|
||||
}
|
||||
@@ -5,4 +5,6 @@
|
||||
];
|
||||
|
||||
services.xserver.wacom.enable = lib.mkDefault config.services.xserver.enable;
|
||||
|
||||
services.hardware.bolt.enable = lib.mkDefault true;
|
||||
}
|
||||
@@ -7,14 +7,14 @@ let
|
||||
|
||||
cfg = config.microsoft-surface;
|
||||
|
||||
version = "6.12.9";
|
||||
version = "6.12.19";
|
||||
kernelPatches = surfacePatches {
|
||||
inherit version;
|
||||
patchFn = ./patches.nix;
|
||||
};
|
||||
kernelPackages = linuxPackage {
|
||||
inherit version kernelPatches;
|
||||
sha256 = "sha256-h74DYN8JMbNA0rrDUWGlSAcPvDqMNSxJ4h6WZmwmrrQ=";
|
||||
sha256 = "sha256-1zvwV77ARDSxadG2FkGTb30Ml865I6KB8y413U3MZTE=";
|
||||
ignoreConfigErrors=true;
|
||||
};
|
||||
|
||||
|
||||
@@ -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 { })
|
||||
)
|
||||
@@ -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 { })
|
||||
)
|
||||
@@ -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 = [
|
||||
];
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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";
|
||||
```
|
||||
@@ -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"
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -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
@@ -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,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
@@ -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**.
|
||||
@@ -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;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{ lib
|
||||
, pkgs
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
cfg = config.hardware.radxa;
|
||||
in {
|
||||
imports = [
|
||||
../rockchip/disko.nix
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{ lib
|
||||
, pkgs
|
||||
, config
|
||||
, ...
|
||||
}: {
|
||||
imports = [
|
||||
../.
|
||||
../../rockchip
|
||||
];
|
||||
|
||||
config = {
|
||||
hardware = {
|
||||
radxa.enable = true;
|
||||
rockchip = {
|
||||
rk3399.enable = true;
|
||||
platformFirmware = lib.mkDefault pkgs.ubootRock4CPlus;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{ lib
|
||||
, pkgs
|
||||
, config
|
||||
, ...
|
||||
}: {
|
||||
imports = [
|
||||
../.
|
||||
../../rockchip
|
||||
];
|
||||
|
||||
config = {
|
||||
hardware = {
|
||||
radxa.enable = true;
|
||||
rockchip = {
|
||||
rk3588.enable = true;
|
||||
platformFirmware = lib.mkDefault pkgs.ubootRock5ModelB;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{ lib
|
||||
, pkgs
|
||||
, config
|
||||
, ...
|
||||
}: {
|
||||
imports = [
|
||||
../.
|
||||
../../rockchip
|
||||
];
|
||||
|
||||
config = {
|
||||
hardware = {
|
||||
radxa.enable = true;
|
||||
rockchip = {
|
||||
rk3399.enable = true;
|
||||
platformFirmware = lib.mkDefault pkgs.ubootRockPi4;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{ lib
|
||||
, pkgs
|
||||
, config
|
||||
, ...
|
||||
}: {
|
||||
imports = [
|
||||
../.
|
||||
../../rockchip
|
||||
];
|
||||
|
||||
config = {
|
||||
hardware = {
|
||||
radxa.enable = true;
|
||||
rockchip = {
|
||||
rk3328.enable = true;
|
||||
platformFirmware = lib.mkDefault pkgs.ubootRockPiE;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -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>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -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"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{ lib
|
||||
, pkgs
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
cfg = config.hardware.rockchip.rk3328;
|
||||
in {
|
||||
options.hardware.rockchip.rk3328 = {
|
||||
enable = lib.mkEnableOption "Rockchip RK3328 support";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
hardware.rockchip.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{ lib
|
||||
, pkgs
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
cfg = config.hardware.rockchip.rk3399;
|
||||
in {
|
||||
options.hardware.rockchip.rk3399 = {
|
||||
enable = lib.mkEnableOption "Rockchip RK3399 support";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
hardware.rockchip.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{ lib
|
||||
, pkgs
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
cfg = config.hardware.rockchip.rk3399;
|
||||
in {
|
||||
config = lib.mkIf cfg.enable {
|
||||
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
|
||||
"arm-trusted-firmware-rk3399"
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{ lib
|
||||
, pkgs
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
cfg = config.hardware.rockchip.rk3588;
|
||||
in {
|
||||
options.hardware.rockchip.rk3588 = {
|
||||
enable = lib.mkEnableOption "Rockchip RK3588 support";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
hardware.rockchip.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{ lib, options, ... }:
|
||||
{
|
||||
imports = [
|
||||
../../common/pc/laptop
|
||||
../../common/pc/ssd
|
||||
];
|
||||
|
||||
# Enable TUXEDO's kernel drivers if they are available
|
||||
hardware = lib.optionalAttrs (options.hardware ? tuxedo-drivers) {
|
||||
tuxedo-drivers.enable = lib.mkDefault true;
|
||||
};
|
||||
}
|
||||
@@ -2,9 +2,8 @@
|
||||
|
||||
{
|
||||
imports = [
|
||||
../../.
|
||||
../../../../common/cpu/intel
|
||||
../../../../common/pc/laptop
|
||||
../../../../common/pc/ssd
|
||||
];
|
||||
|
||||
# Cooling management
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
# [TUXEDO InfinityBook Pro 14 - Gen9 - INTEL](https://www.tuxedocomputers.com/en/TUXEDO-InfinityBook-Pro-14-Gen9-INTEL)
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
imports = [
|
||||
../../.
|
||||
../../../../common/cpu/intel
|
||||
];
|
||||
}
|
||||
Reference in new issue
Block a user