Merge branch 'master' into imxade-patch-1

This commit is contained in:
Rituraj
2025-10-31 21:51:27 +05:30
committed by GitHub
153 changed files with 13982 additions and 1349 deletions

View File

@@ -9,13 +9,13 @@ jobs:
nixfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: cachix/install-nix-action@v31
- run: cd tests && nix fmt .. -- --fail-on-change
- run: nix build .#checks.x86_64-linux.formatting
tests:
needs: nixfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: cachix/install-nix-action@v31
- run: nix run ./tests#run .
- run: nix run .#run-tests

View File

@@ -11,4 +11,4 @@ purism/librem/13v3 @yegortimoshenko
system76/darp6 @khumba
framework @emiller88
tuxedo/pulse/15/gen2 @trueNAHO
tuxedo/pulse/14/gen3 @gabyx @britter @trueNAHO
tuxedo/pulse/14/gen3 @gabyx @britter

View File

@@ -42,7 +42,7 @@ Link the profile in the table in README.md and in flake.nix.
## 3. Testing
Run `nix run ./tests#run .` to evaluate all hardware profiles.
Run `nix run .#run-tests` to evaluate all hardware profiles.
Because profiles can only be tested with the appropriate hardware, quality
assurance is up to *you*.

View File

@@ -85,18 +85,20 @@ All contributors and users are welcome to join!
See code for all available configurations.
| Model | Path | Flake Module |
| --------------------------------------------------------------------------------- | ------------------------------------------------------- | ---------------------------------- |
| --------------------------------------------------------------------------------- | ------------------------------------------------------- | -------------------------------------- |
| [Acer Aspire 4810T](acer/aspire/4810t) | `<nixos-hardware/acer/aspire/4810t>` | `acer-aspire-4810t` |
| [Airis N990](airis/n990) | `<nixos-hardware/airis/n990>` | `airis-n990` |
| [Apple iMac 14.2](apple/imac/14-2) | `<nixos-hardware/apple/imac/14-2>` | `apple-imac-14-2` |
| [Apple iMac 18.2](apple/imac/18-2) | `<nixos-hardware/apple/imac/18-2>` | `apple-imac-18-2` |
| [Apple MacBook Air 3,X](apple/macbook-air/3) | `<nixos-hardware/apple/macbook-air/3>` | `apple-macbook-air-3` |
| [Apple MacBook Air 4,X](apple/macbook-air/4) | `<nixos-hardware/apple/macbook-air/4>` | `apple-macbook-air-4` |
| [Apple MacBook Air 5,X](apple/macbook-air/5) | `<nixos-hardware/apple/macbook-air/5>` | `apple-macbook-air-5` |
| [Apple MacBook Air 6,X](apple/macbook-air/6) | `<nixos-hardware/apple/macbook-air/6>` | `apple-macbook-air-6` |
| [Apple MacBook Air 7,X](apple/macbook-air/7) | `<nixos-hardware/apple/macbook-air/7>` | `apple-macbook-air-7` |
| [Apple MacBook Pro 8,1](apple/macbook-pro/8-1) | `<nixos-hardware/apple/macbook-pro/8-1>` | `apple-macbook-pro-8-1` |
| [Apple MacBook Pro 10,1](apple/macbook-pro/10-1) | `<nixos-hardware/apple/macbook-pro/10-1>` | `apple-macbook-pro-10-1` |
| [Apple MacBook Pro 11,1](apple/macbook-pro/11-1) | `<nixos-hardware/apple/macbook-pro/11-1>` | `apple-macbook-pro-11-1` |
| [Apple MacBook Pro 11,4](apple/macbook-pro/11-4) | `<nixos-hardware/apple/macbook-pro/11-4>` | `apple-macbook-pro-11-4` |
| [Apple MacBook Pro 11,5](apple/macbook-pro/11-5) | `<nixos-hardware/apple/macbook-pro/11-5>` | `apple-macbook-pro-11-5` |
| [Apple MacBook Pro 12,1](apple/macbook-pro/12-1) | `<nixos-hardware/apple/macbook-pro/12-1>` | `apple-macbook-pro-12-1` |
| [Apple MacBook Pro 14,1](apple/macbook-pro/14-1) | `<nixos-hardware/apple/macbook-pro/14-1>` | `apple-macbook-pro-14-1` |
@@ -107,8 +109,10 @@ See code for all available configurations.
| [Asus ROG Ally RC71L (2023)](asus/ally/rc71l) | `<nixos-hardware/asus/ally/rc71l>` | `asus-ally-rc71l` |
| [Asus ROG Flow X13 GV302X\* (2023)](asus/flow/gv302x/amdgpu) | `<nixos-hardware/asus/flow/gv302x/amdgpu>` | `asus-flow-gv302x-amdgpu` |
| [Asus ROG Flow X13 GV302X\* (2023)](asus/flow/gv302x/nvidia) | `<nixos-hardware/asus/flow/gv302x/nvidia>` | `asus-flow-gv302x-nvidia` |
| [Asus ROG GL552VW](asus/rog-gl552vw) | `<nixos-hardware/asus/rog-gl552vw>` | `asus-rog-gl552vw` |
| [Asus ROG Strix G513IM](asus/rog-strix/g513im) | `<nixos-hardware/asus/rog-strix/g513im>` | `asus-rog-strix-g513im` |
| [Asus ROG Strix G533ZW](asus/rog-strix/g533zw) | `<nixos-hardware/asus/rog-strix/g533zw>` | `asus-rog-strix-g533zw` |
| [Asus ROG Strix G533Q](asus/rog-strix/g533q) | `<nixos-hardware/asus/rog-strix/g533q>` | `asus-rog-strix-g533zw` |
| [Asus ROG Strix G713IE](asus/rog-strix/g713ie) | `<nixos-hardware/asus/rog-strix/g713ie>` | `asus-rog-strix-g713ie` |
| [Asus ROG Strix G733QS](asus/rog-strix/g733qs) | `<nixos-hardware/asus/rog-strix/g733qs>` | `asus-rog-strix-g733qs` |
| [Asus ROG Strix X570-E GAMING](asus/rog-strix/x570e) | `<nixos-hardware/asus/rog-strix/x570e>` | `asus-rog-strix-x570e` |
@@ -129,6 +133,7 @@ See code for all available configurations.
| [Asus Zenbook Duo 14 UX481](asus/zenbook/ux481/nvidia/) | `<nixos-hardware/asus/zenbook/ux481/nvidia>` | `asus-zenbook-ux481-nvidia` |
| [Asus Zenbook Flip S13 UX371](asus/zenbook/ux371/) | `<nixos-hardware/asus/zenbook/ux371>` | `asus-zenbook-ux371` |
| [Asus Zenbook Pro 15 UX535](asus/zenbook/ux535/) | `<nixos-hardware/asus/zenbook/ux535>` | `asus-zenbook-ux535` |
| [Asus Zenbook Pro 17 UM6702](asus/zenbook/um6702/) | `<nixos-hardware/asus/zenbook/um6702>` | `asus-zenbook-um6702` |
| [BeagleBoard PocketBeagle](beagleboard/pocketbeagle) | `<nixos-hardware/beagleboard/pocketbeagle>` | `beagleboard-pocketbeagle` |
| [Chuwi MiniBook X](chuwi/minibook-x) | `<nixos-hardware/chuwi/minibook-x>` | `chuwi-minibook-x` |
| [Deciso DEC series](deciso/dec) | `<nixos-hardware/deciso/dec>` | `deciso-dec` |
@@ -159,6 +164,8 @@ See code for all available configurations.
| [Dell Precision 3541](dell/precision/3541) | `<nixos-hardware/dell/precision/3541>` | `dell-precision-3541` |
| [Dell Precision 5490](dell/precision/5490) | `<nixos-hardware/dell/precision/5490>` | `dell-precision-5490` |
| [Dell Precision 5530](dell/precision/5530) | `<nixos-hardware/dell/precision/5530>` | `dell-precision-5530` |
| [Dell Precision 5560](dell/precision/5560) | `<nixos-hardware/dell/precision/5560>` | `dell-precision-5560` |
| [Dell Precision 5570](dell/precision/5570) | `<nixos-hardware/dell/precision/5570>` | `dell-precision-5570` |
| [Dell Precision 7520](dell/precision/7520) | `<nixos-hardware/dell/precision/7520>` | `dell-precision-7520` |
| [Dell XPS 13 7390](dell/xps/13-7390) | `<nixos-hardware/dell/xps/13-7390>` | `dell-xps-13-7390` |
| [Dell XPS 13 9300](dell/xps/13-9300) | `<nixos-hardware/dell/xps/13-9300>` | `dell-xps-13-9300` |
@@ -192,16 +199,18 @@ See code for all available configurations.
| [Dell XPS 17 9700, nvidia](dell/xps/17-9700/nvidia) | `<nixos-hardware/dell/xps/17-9700/nvidia>` | `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-17-9710-intel` |
| [Framework 11th Gen Intel Core](framework/13-inch/11th-gen-intel) | `<nixos-hardware/framework/13-inch/11th-gen-intel>` | `framework-11th-gen-intel` |
| [Framework 12th Gen Intel Core](framework/12-inch/13th-gen-intel) | `<nixos-hardware/framework/12-inch/13th-gen-intel>` | `framework-12th-gen-intel` |
| [Framework 12th Gen Intel Core](framework/13-inch/12th-gen-intel) | `<nixos-hardware/framework/13-inch/12th-gen-intel>` | `framework-12th-gen-intel` |
| [Framework 13th Gen Intel Core](framework/13-inch/13th-gen-intel) | `<nixos-hardware/framework/13-inch/13th-gen-intel>` | `framework-13th-gen-intel` |
| [Framework Intel Core Ultra Series 1](framework/13-inch/intel-core-ultra-series1) | `<nixos-hardware/framework/13-inch/intel-core-ultra-series1>` | `framework-intel-core-ultra-series1` |
| [Framework 13 AMD Ryzen 7040 Series](framework/13-inch/7040-amd) | `<nixos-hardware/framework/13-inch/7040-amd>` | `framework-13-7040-amd` |
| [Framework 13 AMD AI 300 Series](framework/13-inch/amd-ai-300-series) | `<nixos-hardware/framework/13-inch/amd-ai-300-series>` | `framework-amd-ai-300-series` |
| [Framework 12 13th Gen Intel Core](framework/12-inch/13th-gen-intel) | `<nixos-hardware/framework/12-inch/13th-gen-intel>` | `framework-12-13th-gen-intel` |
| [Framework 16 AMD Ryzen 7040 Series](framework/16-inch/7040-amd) | `<nixos-hardware/framework/16-inch/7040-amd>` | `framework-16-7040-amd` |
| [Framework 16 AMD Ryzen AI 300 Series](framework/16-inch/amd-ai-300-series) | `<nixos-hardware/framework/16-inch/amd-ai-300-series>` | `framework-16-amd-ai-300-series` |
| [FriendlyARM NanoPC-T4](friendlyarm/nanopc-t4) | `<nixos-hardware/friendlyarm/nanopc-t4>` | `friendlyarm-nanopc-t4` |
| [FriendlyARM NanoPi R5s](friendlyarm/nanopi-r5s) | `<nixos-hardware/friendlyarm/nanopi-r5s>` | `friendlyarm-nanopi-r5s` |
| [Focus M2 Gen 1](focus/m2/gen1) | `<nixos-hardware/focus/m2/gen1>` | `focus-m2-gen1` |
| [Fydetab Duo](fydetab/duo) | `<nixos-hardware/fydetab/duo>` | `fydetab-duo` |
| [Gigabyte B550](gigabyte/b550) | `<nixos-hardware/gigabyte/b550>` | `gigabyte-b550` |
| [Gigabyte B650](gigabyte/b650) | `<nixos-hardware/gigabyte/b650>` | `gigabyte-b650` |
| [GMKtec NucBox G3 Plus](gmktec/nucbox/g3-plus) | `<nixos-hardware/gmktec/nucbox/g3-plus>` | `gmktec-nucbox-g3-plus` |
@@ -220,11 +229,14 @@ See code for all available configurations.
| [HP Elitebook 845g9](hp/elitebook/845/g9) | `<nixos-hardware/hp/elitebook/845/g9>` | `hp-elitebook-845g9` |
| [HP Laptop 14s-dq2024nf](hp/laptop/14s-dq2024nf) | `<nixos-hardware/hp/laptop/14s-dq2024nf>` | `hp-laptop-14s-dq2024nf` |
| [HP Notebook 14-df0023](hp/notebook/14-df0023) | `<nixos-hardware/hp/notebook/14-df0023>` | `hp-notebook-14-df0023` |
| [HP Probook 440G5](hp/probook/440g5) | `<nixos-hardware/hp/probook/440g5>` | `hp-probook-440G5` |
| [HP Probook 440G5](hp/probook/440G5) | `<nixos-hardware/hp/probook/440G5>` | `hp-probook-440G5` |
| [HP Laptop 14s-dq2024nf](hp/laptop/14s-dq2024nf) | `<nixos-hardware/hp/laptop/14s-dq2024nf>` | `hp-laptop-14s-dq2024nf` |
| [HP Probook 460G11](hp/probook/460g11) | `<nixos-hardware/hp/probook/460g11>` | `hp-probook-46011` |
| [Huawei Matebook X Pro (2020)](huawei/machc-wa) | `<nixos-hardware/huawei/machc-wa>` | `huawei-machc-wa` |
| [i.MX8QuadMax Multisensory Enablement Kit](nxp/imx8qm-mek/) | `<nixos-hardware/nxp/imx8qm-mek>` | `nxp-imx8qm-mek` |
| [Intel NUC 5i5RYB](intel/nuc/5i5ryb/) | `<nixos-hardware/intel/nuc/5i5ryb>` | `intel-nuc-5i5ryb` |
| [Intel NUC 8i7BEH](intel/nuc/8i7beh/) | `<nixos-hardware/intel/nuc/8i7beh>` | `intel-nuc-8i7beh` |
| [Kobol Helios4](kobol/helios4) | `<nixos-hardware/kobol/helios4>` | `kobol-helios-4` |
| [Lenovo IdeaCentre K330](lenovo/ideacentre/k330) | `<nixos-hardware/lenovo/ideacentre/k330>` | `lenovo-ideacentre-k330` |
| [Lenovo IdeaPad 3 15alc6](lenovo/ideapad/15alc6) | `<nixos-hardware/lenovo/ideapad/15alc6>` | `lenovo-ideapad-15alc6` |
| [Lenovo IdeaPad Gaming 3 15arh05](lenovo/ideapad/15arh05) | `<nixos-hardware/lenovo/ideapad/15arh05>` | `lenovo-ideapad-15arh05` |
@@ -237,6 +249,8 @@ See code for all available configurations.
| [Lenovo IdeaPad 2-in-1 16ahp9](lenovo/ideapad/16ahp9) | `<nixos-hardware/lenovo/ideapad/16ahp9>` | `lenovo-ideapad-16ahp9` |
| [Lenovo IdeaPad S145 15api](lenovo/ideapad/s145-15api) | `<nixos-hardware/lenovo/ideapad/s145-15api>` | `lenovo-ideapad-s145-15api` |
| [Lenovo Legion 5 15ach6h](lenovo/legion/15ach6h) | `<nixos-hardware/lenovo/legion/15ach6h>` | `lenovo-legion-15ach6h` |
| [Lenovo Legion 5 15ach6h (Hybrid)](lenovo/legion/15ach6h/hybrid) | `<nixos-hardware/lenovo/legion/15ach6h/hybrid>` | `lenovo-legion-15ach6h-hybrid` |
| [Lenovo Legion 5 15ach6h (Nvidia)](lenovo/legion/15ach6h/hybrid) | `<nixos-hardware/lenovo/legion/15ach6h/nvidia>` | `lenovo-legion-15ach6h-nvidia` |
| [Lenovo Legion 5 15arh05h](lenovo/legion/15arh05h) | `<nixos-hardware/lenovo/legion/15arh05h>` | `lenovo-legion-15arh05h` |
| [Lenovo Legion 7 Slim 15ach6](lenovo/legion/15ach6) | `<nixos-hardware/lenovo/legion/15ach6>` | `lenovo-legion-15ach6` |
| [Lenovo Legion 5 Pro 16ach6h](lenovo/legion/16ach6h) | `<nixos-hardware/lenovo/legion/16ach6h>` | `lenovo-legion-16ach6h` |
@@ -249,9 +263,10 @@ See code for all available configurations.
| [Lenovo Legion 7 16achg6 (Nvidia)](lenovo/legion/16achg6/nvidia) | `<nixos-hardware/lenovo/legion/16achg6/nvidia>` | `lenovo-legion-16achg6-nvidia` |
| [Lenovo Legion 7i Pro 16irx8h (Intel)](lenovo/legion/16irx8h) | `<nixos-hardware/lenovo/legion/16irx8h>` | `lenovo-legion-16irx8h` |
| [Lenovo Legion 7 Pro 16irx9h (Intel)](lenovo/legion/16irx9h) | `<nixos-hardware/lenovo/legion/16irx9h>` | `lenovo-legion-16irx9h` |
| [Lenovo Legion Slim 5](lenovo/legion/16aph8/) | `<nixos-hardware/lenovo/legion/16aph8>` | `lenovo-legion-16aph8` |
| [Lenovo Legion Slim 7 Gen 7 (AMD)](lenovo/legion/16arha7/) | `<nixos-hardware/lenovo/legion/16arha7>` | `lenovo-legion-16arha7` |
| [Lenovo Legion T5 AMR5](lenovo/legion/t526amr5) | `<nixos-hardware/lenovo/legion/t526amr5>` | `lenovo-legion-t526amr5` |
| [Lenovo Legion Y530 15ICH](lenovo/legion/15ich) | `<nixos-hardware/lenovo/legion/15ich>` | `lenovo-legion-15ich` |
| [Lenovo Legion Y530 15ICH](lenovo/legion/15ich) | `<nixos-hardware/lenovo/legion/15ich>` | `lenovo-legion-y530-15ich` |
| [Lenovo ThinkPad A475](lenovo/thinkpad/a475) | `<nixos-hardware/lenovo/thinkpad/a475>` | `lenovo-thinkpad-a475` |
| [Lenovo ThinkPad E14 (AMD)](lenovo/thinkpad/e14/amd) | `<nixos-hardware/lenovo/thinkpad/e14/amd>` | `lenovo-thinkpad-e14-amd` |
| [Lenovo ThinkPad E14 (Intel - Gen 1)](lenovo/thinkpad/e14/intel) | `<nixos-hardware/lenovo/thinkpad/e14/intel>` | `lenovo-thinkpad-e14-intel` |
@@ -271,10 +286,12 @@ 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-gen3` |
| [Lenovo ThinkPad P14s AMD Gen 4](lenovo/thinkpad/p14s/amd/gen4) | `<nixos-hardware/lenovo/thinkpad/p14s/amd/gen4>` | `lenovo-thinkpad-p14s-amd-gen4` |
| [Lenovo ThinkPad P14s AMD Gen 5](lenovo/thinkpad/p14s/amd/gen5) | `<nixos-hardware/lenovo/thinkpad/p14s/amd/gen5>` | `lenovo-thinkpad-p14s-amd-gen5` |
| [Lenovo ThinkPad P14s Intel Gen 2](lenovo/thinkpad/p14s/intel/gen2) | `<nixos-hardware/lenovo/thinkpad/p14s/intel/gen2>` | `lenovo-thinkpad-p14s-intel-gen2` |
| [Lenovo ThinkPad P14s Intel Gen 3](lenovo/thinkpad/p14s/intel/gen3) | `<nixos-hardware/lenovo/thinkpad/p14s/intel/gen3>` | `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-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-gen1` |
| [Lenovo ThinkPad P16s AMD Gen 2](lenovo/thinkpad/p16s/amd/gen2) | `<nixos-hardware/lenovo/thinkpad/p16s/amd/gen2>` | `lenovo-thinkpad-p16s-amd-gen2` |
| [Lenovo ThinkPad P16s AMD Gen 4](lenovo/thinkpad/p16s/amd/gen4) | `<nixos-hardware/lenovo/thinkpad/p16s/amd/gen4>` | `lenovo-thinkpad-p16s-amd-gen4` |
| [Lenovo ThinkPad P16s Intel Gen 2](lenovo/thinkpad/p16s/intel/gen2) | `<nixos-hardware/lenovo/thinkpad/p16s/intel/gen2>` | `lenovo-thinkpad-p16s-intel-gen2` |
| [Lenovo ThinkPad P1](lenovo/thinkpad/p1) | `<nixos-hardware/lenovo/thinkpad/p1>` | `lenovo-thinkpad-p1` |
| [Lenovo ThinkPad P43s](lenovo/thinkpad/p43s) | `<nixos-hardware/lenovo/thinkpad/p43s>` | `lenovo-thinkpad-p43s` |
@@ -288,6 +305,9 @@ See code for all available configurations.
| [Lenovo ThinkPad T14 AMD Gen 4](lenovo/thinkpad/t14/amd/gen4) | `<nixos-hardware/lenovo/thinkpad/t14/amd/gen4>` | `lenovo-thinkpad-t14-amd-gen4` |
| [Lenovo ThinkPad T14 AMD Gen 5](lenovo/thinkpad/t14/amd/gen5) | `<nixos-hardware/lenovo/thinkpad/t14/amd/gen5>` | `lenovo-thinkpad-t14-amd-gen5` |
| [Lenovo ThinkPad T14](lenovo/thinkpad/t14) | `<nixos-hardware/lenovo/thinkpad/t14>` | `lenovo-thinkpad-t14` |
| [Lenovo ThinkPad T14 Intel Gen 1](lenovo/thinkpad/t14/intel/gen1) | `<nixos-hardware/lenovo/thinkpad/t14/intel/gen1>` | `lenovo-thinkpad-t14-intel-gen1` |
| [Lenovo ThinkPad T14 Intel Gen 1 (Nvidia)](lenovo/thinkpad/t14/intel/gen1/nvidia) | `<nixos-hardware/lenovo/thinkpad/t14/intel/gen1/nvidia>`| `lenovo-thinkpad-t14-intel-gen1-nvidia`|
| [Lenovo ThinkPad T14 Intel Gen 6](lenovo/thinkpad/t14/intel/gen6) | `<nixos-hardware/lenovo/thinkpad/t14/intel/gen6>` | `lenovo-thinkpad-t14-intel-gen6` |
| [Lenovo ThinkPad T14s AMD Gen 1](lenovo/thinkpad/t14s/amd/gen1) | `<nixos-hardware/lenovo/thinkpad/t14s/amd/gen1>` | `lenovo-thinkpad-t14s-amd-gen1` |
| [Lenovo ThinkPad T14s AMD Gen 4](lenovo/thinkpad/t14s/amd/gen4) | `<nixos-hardware/lenovo/thinkpad/t14s/amd/gen4>` | `lenovo-thinkpad-t14s-amd-gen4` |
| [Lenovo ThinkPad T14s](lenovo/thinkpad/t14s) | `<nixos-hardware/lenovo/thinkpad/t14s>` | `lenovo-thinkpad-t14s` |
@@ -340,8 +360,8 @@ See code for all available configurations.
| [Lenovo ThinkPad X280](lenovo/thinkpad/x280) | `<nixos-hardware/lenovo/thinkpad/x280>` | `lenovo-thinkpad-x280` |
| [Lenovo ThinkPad X390](lenovo/thinkpad/x390) | `<nixos-hardware/lenovo/thinkpad/x390>` | `lenovo-thinkpad-x390` |
| [Lenovo ThinkPad Z Series](lenovo/thinkpad/z) | `<nixos-hardware/lenovo/thinkpad/z>` | `lenovo-thinkpad-z` |
| [Lenovo ThinkPad Z13 Gen 1](lenovo/thinkpad/z/gen1/z13) | `<nixos-hardware/lenovo/thinkpad/z/gen1/z13>` | `lenovo-thinkpad-z-gen1-z13` |
| [Lenovo ThinkPad Z13 Gen 2](lenovo/thinkpad/z/gen2/z13) | `<nixos-hardware/lenovo/thinkpad/z/gen2/z13>` | `lenovo-thinkpad-z-gen2-z13` |
| [Lenovo ThinkPad Z13 Gen 1](lenovo/thinkpad/z/gen1/z13) | `<nixos-hardware/lenovo/thinkpad/z/gen1/z13>` | `lenovo-thinkpad-z13-gen1` |
| [Lenovo ThinkPad Z13 Gen 2](lenovo/thinkpad/z/gen2/z13) | `<nixos-hardware/lenovo/thinkpad/z/gen2/z13>` | `lenovo-thinkpad-z13-gen2` |
| [Lenovo XiaoXin Pro 14imh9 2024](lenovo/ideapad/14imh9) | `<nixos-hardware/lenovo/ideapad/14imh9>` | `lenovo-ideapad-14imh9` |
| [LENOVO Yoga 6 13ALC6 82ND](lenovo/yoga/6/13ALC6) | `<nixos-hardware/lenovo/yoga/6/13ALC6>` | `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-7-14ARH7-amdgpu` |
@@ -350,25 +370,32 @@ See code for all available configurations.
| [Lenovo Yoga Slim 7i Pro X 14IAH7 (Hybrid)](lenovo/yoga/7/14IAH7/hybrid) | `<nixos-hardware/lenovo/yoga/7/14IAH7/hybrid>` | `lenovo-yoga-7-14IAH7-hybrid` |
| [Lenovo Yoga Slim 7 14ILL10](lenovo/yoga/7/14ILL10) | `<nixos-hardware/lenovo/yoga/7/14ILL10>` | `lenovo-yoga-7-14ILL10` |
| [LENOVO Yoga 7 Slim Gen8](lenovo/yoga/7/slim/gen8) | `<nixos-hardware/lenovo/yoga/7/slim/gen8>` | `lenovo-yoga-7-slim-gen8` |
| [Linglong Nova Studio](linglong/nova-studio) | `<nixos-hardware/linglong/nova-studio>` | `linglong-nova-studio` |
| [MSI B550-A PRO](msi/b550-a-pro) | `<nixos-hardware/msi/b550-a-pro>` | `msi-b550-a-pro` |
| [MSI B350 TOMAHAWK](msi/b350-tomahawk) | `<nixos-hardware/msi/b350-tomahawk>` | `msi-b350-tomahawk` |
| [MSI B550 TOMAHAWK](msi/b550-tomahawk) | `<nixos-hardware/msi/b550-tomahawk>` | `msi-b550-tomahawk` |
| [MSI GS60 2QE](msi/gs60) | `<nixos-hardware/msi/gs60>` | `msi-gs60` |
| [MSI GL62/CX62](msi/gl62) | `<nixos-hardware/msi/gl62>` | `msi-gl62` |
| [MSI GL65 10SDR-492](msi/gl65/10SDR-492) | `<nixos-hardware/msi/gl65/10SDR-492>` | `msi-gl65-10SDR-492` |
| [Malibal Aon S1](malibal/aon/s1) | | `<nixos-hardware/malibal/aon/s1>` | `malibal-aon-s1` |
| [Microchip Icicle Kit](microchip/icicle-kit) | `<nixos-hardware/microchip/icicle-kit>` | `microchip-icicle-kit` |
| [Microsoft Surface Go](microsoft/surface/surface-go) | `<nixos-hardware/microsoft/surface/surface-go>` | `microsoft-surface-surface-go` |
| [Microsoft Surface Pro (Intel)](microsoft/surface/surface-pro-intel) | `<nixos-hardware/microsoft/surface/surface-pro-intel>` | `microsoft-surface-surface-pro-intel` |
| [Microsoft Surface Laptop (AMD)](microsoft/surface/surface-laptop-amd) | `<nixos-hardware/microsoft/surface/surface-laptop-amd>` | `microsoft-surface-surface-laptop-amd` |
| [Microsoft Surface Go](microsoft/surface/surface-go) | `<nixos-hardware/microsoft/surface/surface-go>` | `microsoft-surface-go` |
| [Microsoft Surface Pro (Intel)](microsoft/surface/surface-pro-intel) | `<nixos-hardware/microsoft/surface/surface-pro-intel>` | `microsoft-surface-pro-intel` |
| [Microsoft Surface Laptop (AMD)](microsoft/surface/surface-laptop-amd) | `<nixos-hardware/microsoft/surface/surface-laptop-amd>` | `microsoft-surface-laptop-amd` |
| [Microsoft Surface Range (Common Modules)](microsoft/surface/common) | `<nixos-hardware/microsoft/surface/common>` | `microsoft-surface-common` |
| [Microsoft Surface Pro 3](microsoft/surface-pro/3) | `<nixos-hardware/microsoft/surface-pro/3>` | `microsoft-surface-pro-3` |
| [Microsoft Surface Pro 9](microsoft/surface-pro/9) | `<nixos-hardware/microsoft/surface-pro/9>` | `microsoft-surface-pro-9` |
| [Milk-V Pioneer](milkv/pioneer) | `<nixos-hardware/milkv/pioneer>` | `milkv-pioneer` |
| [Morefine M600](morefine/m600) | `<nixos-hardware/morefine/m600>` | `morefine-m600` |
| [Minisforum V3](minisforum/v3) | `<nixos-hardware/minisforum/v3>` | `minisforum-v3` |
| [MNT Reform with RK3588 module](mnt/reform/rk3588) | `<nixos-hardware/mnt/reform/rk3588` | `mnt-reform-rk3588` |
| [MECHREVO Yilong15Pro](mechrevo/GM5HG0A) | `<nixos-hardware/mechrevo/GM5HG0A>` | `mechrevo-gm5hg0a` |
| [NXP iMX8 MPlus Evaluation Kit](nxp/imx8mp-evk) | `<nixos-hardware/nxp/imx8mp-evk>` | `nxp-imx8mp-evk` |
| [NXP iMX8 MQuad Evaluation Kit](nxp/imx8mq-evk) | `<nixos-hardware/nxp/imx8mq-evk>` | `nxp-imx8mq-evk` |
| [Hardkernel Odroid HC4](hardkernel/odroid-hc4/default.nix) | `<nixos-hardware/hardkernel/odroid-hc4>` | `hardkernel-odroid-hc4` |
| [Hardkernel Odroid H3](hardkernel/odroid-h3/default.nix) | `<nixos-hardware/hardkernel/odroid-h3>` | `hardkernel-odroid-h3` |
| [Hardkernel Odroid H4](hardkernel/odroid-h4/default.nix) | `<nixos-hardware/hardkernel/odroid-h4>` | `hardkernel-odroid-h4` |
| [Olimex TERES-I](olimex/teres_i) | `<nixos-hardware/olimex/teres_i>` | `olimex-teres_i` |
| [Omen 14-fb0798ng](omen/14-fb0798ng) | `<nixos-hardware/omen/14-fb0798ng>` | `omen-14-fb0798ng` |
| [Omen 15-ce002ns](omen/15-ce002ns) | `<nixos-hardware/omen/15-ce002ns>` | `omen-15-ce002ns` |
| [Omen 15-en0010ca](omen/15-en0010ca) | `<nixos-hardware/omen/15-en0010ca>` | `omen-15-en0010ca` |
@@ -377,7 +404,8 @@ See code for all available configurations.
| [Omen 15-en1007sa](omen/15-en1007sa) | `<nixos-hardware/omen/15-en1007sa>` | `omen-15-en1007sa` |
| [Omen 15-en0002np](omen/15-en0002np) | `<nixos-hardware/omen/15-en0002np>` | `omen-15-en0002np` |
| [One-Netbook OneNetbook 4](onenetbook/4) | `<nixos-hardware/onenetbook/4>` | `onenetbook-4` |
| [Panasonic Let's Note CF-LX4](panasonic/letsnote/cf-lx4) | `<nixos-hardware/panasonic/letsnote/cf-lx4>` | `panasonic-letsnote-cf-lx4` |
| [Panasonic Let's Note CF-LX3](panasonic/letsnote/cf-lx3) | `<nixos-hardware/panasonic/letsnote/cf-lx3>` | `panasonic-letsnote-cf-lx3` |
| [Panasonic Let's Note CF-LX4](panasonic/letsnote/cf-lx4) | `<nixos-hardware/panasonic/letsnote/cf-lx4>` | `letsnote-cf-lx4` |
| [PC Engines APU](pcengines/apu) | `<nixos-hardware/pcengines/apu>` | `pcengines-apu` |
| [PINE64 Pinebook Pro](pine64/pinebook-pro/) | `<nixos-hardware/pine64/pinebook-pro>` | `pine64-pinebook-pro` |
| [PINE64 RockPro64](pine64/rockpro64/) | `<nixos-hardware/pine64/rockpro64>` | `pine64-rockpro64` |

View File

@@ -1,10 +1,6 @@
{ config, lib, ... }:
{
boot.kernelParams = [
"hid_apple.iso_layout=0"
];
hardware.facetimehd.enable = lib.mkDefault (config.nixpkgs.config.allowUnfree or false);
services.mbpfan.enable = lib.mkDefault true;

View File

@@ -29,7 +29,6 @@
"bcma"
];
kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.0") pkgs.linuxPackages_latest;
extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ];
};
hardware = {

View File

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

View File

@@ -1,8 +1,10 @@
{ lib, ... }:
{ config, lib, ... }:
{
imports = [ ../. ];
boot.blacklistedKernelModules = [ "bcma" ];
boot = {
# Divides power consumption by two.
kernelParams = [ "acpi_osi=" ];

View File

@@ -6,9 +6,5 @@
../../../common/cpu/intel/haswell
];
# broadcom-wl
hardware.enableRedistributableFirmware = lib.mkDefault true;
# nixos-generate-config doesn't detect this automatically.
boot.extraModulePackages = with config.boot.kernelPackages; [ broadcom_sta ];
boot.kernelModules = [ "wl" ];
}

View File

@@ -0,0 +1,42 @@
# Apple MacBookPro11,4
[Product page](https://support.apple.com/en-us/111955)
## Tested Hardware
```console
foo@bar:~$ lspci -nn
00:00.0 Host bridge [0600]: Intel Corporation Crystal Well DRAM Controller [8086:0d04] (rev 08)
00:01.0 PCI bridge [0604]: Intel Corporation Crystal Well PCI Express x16 Controller [8086:0d01] (rev 08)
00:01.1 PCI bridge [0604]: Intel Corporation Crystal Well PCI Express x8 Controller [8086:0d05] (rev 08)
00:02.0 VGA compatible controller [0300]: Intel Corporation Crystal Well Integrated Graphics Controller [8086:0d26] (rev 08)
00:03.0 Audio device [0403]: Intel Corporation Crystal Well HD Audio Controller [8086:0d0c] (rev 08)
00:14.0 USB controller [0c03]: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI [8086:8c31] (rev 05)
00:16.0 Communication controller [0780]: Intel Corporation 8 Series/C220 Series Chipset Family MEI Controller #1 [8086:8c3a] (rev 04)
00:1b.0 Audio device [0403]: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller [8086:8c20] (rev 05)
00:1c.0 PCI bridge [0604]: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #1 [8086:8c10] (rev d5)
00:1c.2 PCI bridge [0604]: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #3 [8086:8c14] (rev d5)
00:1c.3 PCI bridge [0604]: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #4 [8086:8c16] (rev d5)
00:1f.0 ISA bridge [0601]: Intel Corporation HM87 Express LPC Controller [8086:8c4b] (rev 05)
00:1f.3 SMBus [0c05]: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller [8086:8c22] (rev 05)
00:1f.6 Signal processing controller [1180]: Intel Corporation 8 Series Chipset Family Thermal Management Controller [8086:8c24] (rev 05)
01:00.0 SATA controller [0106]: Samsung Electronics Co Ltd S4LN058A01[SSUBX] AHCI SSD Controller (Apple slot) [144d:a801] (rev 01)
03:00.0 Network controller [0280]: Broadcom Inc. and subsidiaries BCM43602 802.11ac Wireless LAN SoC [14e4:43ba] (rev 01)
04:00.0 Multimedia controller [0480]: Broadcom Inc. and subsidiaries 720p FaceTime HD Camera [14e4:1570]
05:00.0 PCI bridge [0604]: Intel Corporation DSL5520 Thunderbolt 2 Bridge [Falcon Ridge 4C 2013] [8086:156d]
06:00.0 PCI bridge [0604]: Intel Corporation DSL5520 Thunderbolt 2 Bridge [Falcon Ridge 4C 2013] [8086:156d]
06:03.0 PCI bridge [0604]: Intel Corporation DSL5520 Thunderbolt 2 Bridge [Falcon Ridge 4C 2013] [8086:156d]
06:04.0 PCI bridge [0604]: Intel Corporation DSL5520 Thunderbolt 2 Bridge [Falcon Ridge 4C 2013] [8086:156d]
06:05.0 PCI bridge [0604]: Intel Corporation DSL5520 Thunderbolt 2 Bridge [Falcon Ridge 4C 2013] [8086:156d]
06:06.0 PCI bridge [0604]: Intel Corporation DSL5520 Thunderbolt 2 Bridge [Falcon Ridge 4C 2013] [8086:156d]
07:00.0 System peripheral [0880]: Intel Corporation DSL5520 Thunderbolt 2 NHI [Falcon Ridge 4C 2013] [8086:156c]
```
## Tested Nix Configuration
- system: `"x86_64-linux"`
- host os: `Linux 6.12.36, NixOS, 25.11 (Xantusia), 25.11.20250708.9807714`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.28.4`
- channels(root): `"nixos"`
- nixpkgs: `/nix/store/bgl6ldj5ihbwcq8p42z3a0qzgqafgk2b-source`

View File

@@ -0,0 +1,17 @@
{
lib,
config,
pkgs,
modulesPath,
...
}:
{
imports = [
../.
../../../common/cpu/intel/haswell
../../../common/pc/ssd
"${modulesPath}/hardware/network/broadcom-43xx.nix"
];
hardware.graphics.enable = lib.mkDefault true;
}

View File

@@ -9,7 +9,6 @@ This means it might be required to restart your wifi deamon i.e. wpa_supplicant:
powerManagement.powerUpCommands = ''
${pkgs.systemd}/bin/systemctl restart wpa_supplicant.service
'';
};
```
You can apply this to your network management software of choice.

View File

@@ -12,7 +12,6 @@
"b43-firmware"
];
}
```
### For all packages

View File

@@ -1,5 +1,5 @@
{
"base_url": "https://raw.githubusercontent.com/t2linux/linux-t2-patches/8ec11f3aaa314d25e18842851a2124c0031e2e3f/",
"base_url": "https://raw.githubusercontent.com/t2linux/linux-t2-patches/6b41c3fd65913e0fa3592ad16ff4a3a5b01efc7a/",
"patches": [
{
"name": "1001-Add-apple-bce-driver.patch",
@@ -37,29 +37,9 @@
"name": "1011-HID-multitouch-add-device-ID-for-Apple-Touch-Bar.patch",
"hash": "sha256-dIzEOj89D2rIEc2/mjq3TkIfI3ZHzu0VRDQQOzp+Snc="
},
{
"name": "1013-lib-vsprintf-Add-support-for-generic-FourCCs-by-exte.patch",
"hash": "sha256-g8M3j1ZPND10/LtPD/txaSoJGV9Lp+g5bgn+vQc56p4="
},
{
"name": "1014-printf-add-tests-for-generic-FourCCs.patch",
"hash": "sha256-5Z4cFBMAY695OEU/CxiGQkUz68zmKdxssD+yp1DCYgs="
},
{
"name": "1015-drm-appletbdrm-use-p4cl-instead-of-p4cc.patch",
"hash": "sha256-rZej0ZbpPv+8NROuYnf4Jpu9scCsmbKWyz7yf5A3G3s="
},
{
"name": "1016-vsprintf-Use-p4chR-instead-of-p4cn-for-reading-data-.patch",
"hash": "sha256-/Ork2CmYk6SG213Owk+nGsw7KTEVDLRzQTeWcKrPZGw="
},
{
"name": "1017-checkpatch-remove-p4cn.patch",
"hash": "sha256-lnMnjnMiR9WSNf/XYsiOwFdC9xKv8zSluWiR584xFPU="
},
{
"name": "2008-i915-4-lane-quirk-for-mbp15-1.patch",
"hash": "sha256-Ui9tK4IGSWfEscmD92emX/NfulO0m8zwLc9ivIClCFQ="
"hash": "sha256-PjMVt4u505PXnKFpojov0Uwhj0KxZas1E4NYJGI6lQ4="
},
{
"name": "2009-apple-gmux-allow-switching-to-igpu-at-probe.patch",
@@ -103,7 +83,7 @@
},
{
"name": "4001-asahi-trackpad.patch",
"hash": "sha256-QM/FtDft4N4imJBuEHg6cH3e8vEyMPLt0alDhugLPy8="
"hash": "sha256-nOpQ3t+QQXco6p7C03fM5EZ3ZfnzwC6UCFwHQd1EnGE="
},
{
"name": "4002-HID-quirks-remove-T2-devices-from-hid_mouse_ignore_l.patch",
@@ -115,7 +95,7 @@
},
{
"name": "4004-HID-magicmouse-Add-support-for-trackpads-found-on-T2.patch",
"hash": "sha256-HcPX7gY3hnlwM/tY06pbtXnch04AqwHgC596E8ZqGY8="
"hash": "sha256-dNrpDlIE9SaQUOntVQHMOyj7T/dsuRemN56yskKWue0="
},
{
"name": "4005-HID-apple-Add-necessary-IDs-and-support-for-replacem.patch",
@@ -123,15 +103,15 @@
},
{
"name": "4006-HID-magicmouse-Add-MacBookPro15-1-replacement-trackp.patch",
"hash": "sha256-uAlT/4ADwYyKvbuPQaGwqCjZ2/myruC63etVV6cfFLk="
"hash": "sha256-mMqHhxig+Z9eVPaa1qfcNVCRX16B6/KuEd1KnSZMLLk="
},
{
"name": "7001-drm-i915-fbdev-Discard-BIOS-framebuffers-exceeding-h.patch",
"hash": "sha256-O6RHFxmKZn7aCq1D+r5z2T3jLt0r5+01EABD9rs0E5M="
"hash": "sha256-/EKN7JsAxcpAgfJFtPp2NLYaGqQ0kl8wjJEXifSzJpY="
},
{
"name": "8001-Add-APFS-driver.patch",
"hash": "sha256-io17Kk6FDscDoDshddK9TqSPuXVFTzjvRUwOGTl5cjM="
"hash": "sha256-uR5hg75SFFWzfrKyU5UnzPL4U7LkjqGs44rkxM7ur8o="
},
{
"name": "8002-Necessary-modifications-to-build-APFS-with-the-kerne.patch",

View File

@@ -1,6 +1,6 @@
{ callPackage, linux_6_15, ... }@args:
{ callPackage, linux_6_16, ... }@args:
callPackage ./generic.nix args {
kernel = linux_6_15;
kernel = linux_6_16;
patchesFile = ./latest.json;
}

View File

@@ -1,5 +1,5 @@
{
"base_url": "https://raw.githubusercontent.com/t2linux/linux-t2-patches/e08a76e1f1234885b9b68be6c843bf91833e8b0a/",
"base_url": "https://raw.githubusercontent.com/t2linux/linux-t2-patches/5eaf1261d069bbc67aba7fe2737a5fe981e05a9e/",
"patches": [
{
"name": "1001-Add-apple-bce-driver.patch",
@@ -49,10 +49,6 @@
"name": "1013-lib-vsprintf-Add-support-for-generic-FourCCs-by-exte.patch",
"hash": "sha256-h3gxaKtvdm/GSd+AP1sPC9avWHOsceUxTmoua/3rIf4="
},
{
"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-tDjK/VipVQbuNOURW38gssqeRLy3s8I+DVq0+4zGnHs="
@@ -103,7 +99,7 @@
},
{
"name": "4001-asahi-trackpad.patch",
"hash": "sha256-NOuGgUxDQEfFPlij/EnhWmgqeG3/l+j+r2T1YJG7raY="
"hash": "sha256-kfAYVovukZLD5ocHQxhoHJSa9c5XAJ1GhH1RlzGkS+k="
},
{
"name": "4002-HID-quirks-remove-T2-devices-from-hid_mouse_ignore_l.patch",
@@ -131,7 +127,7 @@
},
{
"name": "8001-Add-APFS-driver.patch",
"hash": "sha256-O3RNtpeZQENPEfyYi/0ZTLhAWBAw6pmxMS30NUxOTdk="
"hash": "sha256-QpIPsMjWNPOkw6rSKn7rW0Fmx9HUwJaiGy3pZeT5Fd0="
},
{
"name": "8002-Necessary-modifications-to-build-APFS-with-the-kerne.patch",

View File

@@ -31,10 +31,14 @@ in
wantedBy = [
"local-fs.target"
"suspend.target"
"suspend-then-hibernate.target"
"hibernate.target"
];
after = [
"local-fs.target"
"suspend.target"
"suspend-then-hibernate.target"
"hibernate.target"
];
description = "Set the battery charge threshold to ${toString cfg.chargeUpto}%";
startLimitBurst = 5;

View File

@@ -39,6 +39,7 @@
};
hardware.nvidia = {
powerManagement.enable = lib.mkDefault true;
modesetting.enable = lib.mkDefault true;
open = lib.mkDefault false;
nvidiaSettings = lib.mkDefault true;

View File

@@ -0,0 +1,16 @@
{ ... }:
{
imports = [
../../common/cpu/intel/skylake
../../common/gpu/nvidia/maxwell
../../common/gpu/nvidia/prime.nix
../../common/pc/laptop
../../common/pc/ssd
];
hardware.nvidia.prime = {
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
}

View File

@@ -0,0 +1,18 @@
{ ... }:
{
imports = [
../../../common/cpu/amd
../../../common/cpu/amd/pstate.nix
../../../common/gpu/nvidia/prime.nix
../../../common/gpu/nvidia/ampere
../../../common/pc/laptop
../../../common/pc/ssd
../../battery.nix
];
hardware.nvidia.prime = {
amdgpuBusId = "PCI:6:0:0";
nvidiaBusId = "PCI:1:0:0";
};
}

View File

@@ -0,0 +1,36 @@
{ lib, ... }:
let
inherit (lib) mkDefault;
in
{
imports = [
../../../common/cpu/amd
../../../common/cpu/amd/pstate.nix
# iGPU
../../../common/gpu/amd
# dGPU
../../../common/gpu/nvidia/prime.nix
../../../common/gpu/nvidia/ampere
../../../common/pc/laptop
../../../common/pc/ssd
../../battery.nix
];
hardware.nvidia = {
dynamicBoost.enable = mkDefault true;
powerManagement = {
enable = mkDefault true;
finegrained = mkDefault true;
};
prime = {
amdgpuBusId = "PCI:1:0:0";
nvidiaBusId = "PCI:101:0:0";
};
};
}

View File

@@ -3,6 +3,4 @@
./cpu-only.nix
../../../gpu/intel/comet-lake
];
hardware.intelgpu.vaapiDriver = "intel-media-driver";
}

View File

@@ -1,9 +1,8 @@
{ lib, pkgs, ... }:
{
imports = [ ../. ];
hardware.intelgpu = {
computeRuntime = "legacy";
vaapiDriver = "intel-vaapi-driver";
enableHybridCodec = true;
};

View File

@@ -7,5 +7,8 @@
"i915.enable_guc=2"
];
hardware.intelgpu.vaapiDriver = "intel-media-driver";
hardware.intelgpu = {
computeRuntime = "legacy";
vaapiDriver = "intel-media-driver";
};
}

View File

@@ -3,5 +3,8 @@
boot.kernelParams = [ "i915.enable_guc=2" ];
hardware.intelgpu.vaapiDriver = "intel-media-driver";
hardware.intelgpu = {
computeRuntime = "legacy";
vaapiDriver = "intel-media-driver";
};
}

View File

@@ -23,6 +23,15 @@
default = true;
};
computeRuntime = lib.mkOption {
description = "intel-compute-runtime variant to use";
type = lib.types.enum [
"default"
"legacy"
];
default = "default";
};
vaapiDriver = lib.mkOption {
description = "Intel VAAPI driver to use (use null to use both)";
type = lib.types.nullOr (
@@ -59,7 +68,11 @@
useIntelMediaDriver = cfg.vaapiDriver == "intel-media-driver" || cfg.vaapiDriver == null;
intel-media-driver = pkgs.intel-media-driver;
intel-media-driver-32 = pkgs.driversi686Linux.intel-media-driver;
intel-compute-runtime = pkgs.intel-compute-runtime;
intel-compute-runtime =
if cfg.computeRuntime == "legacy" then
pkgs.intel-compute-runtime-legacy1
else
pkgs.intel-compute-runtime;
vpl-gpu-rt = pkgs.vpl-gpu-rt or pkgs.onevpl-intel-gpu;
in
{

View File

@@ -3,5 +3,8 @@
boot.kernelParams = [ "i915.enable_guc=2" ];
hardware.intelgpu.vaapiDriver = "intel-media-driver";
hardware.intelgpu = {
computeRuntime = "legacy";
vaapiDriver = "intel-media-driver";
};
}

View File

@@ -7,5 +7,8 @@
"i915.enable_psr=2"
];
hardware.intelgpu.vaapiDriver = "intel-media-driver";
hardware.intelgpu = {
computeRuntime = "legacy";
vaapiDriver = "intel-media-driver";
};
}

View File

@@ -1,5 +1,3 @@
{ pkgs, ... }:
{
imports = [ ../. ];
@@ -12,6 +10,7 @@
# 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 = {
computeRuntime = "legacy";
vaapiDriver = "intel-vaapi-driver";
enableHybridCodec = true;
};

View File

@@ -10,10 +10,4 @@
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 ];
};
}

View File

@@ -0,0 +1,32 @@
# Dell Precision 5570
## Tested Hardware
```bash
lspci -nn
00:00.0 Host bridge [0600]: Intel Corporation 12th Gen Core Processor Host Bridge/DRAM Registers [8086:4641] (rev 02)
00:01.0 PCI bridge [0604]: Intel Corporation 12th Gen Core Processor PCI Express x16 Controller #1 [8086:460d] (rev 02)
00:02.0 VGA compatible controller [0300]: Intel Corporation Alder Lake-P GT2 [Iris Xe Graphics] [8086:46a6] (rev 0c)
00:04.0 Signal processing controller [1180]: Intel Corporation Alder Lake Innovation Platform Framework Processor Participant [8086:461d] (rev 02)
00:06.0 PCI bridge [0604]: Intel Corporation 12th Gen Core Processor PCI Express x4 Controller #0 [8086:464d] (rev 02)
00:07.0 PCI bridge [0604]: Intel Corporation Alder Lake-P Thunderbolt 4 PCI Express Root Port #0 [8086:466e] (rev 02)
00:07.1 PCI bridge [0604]: Intel Corporation Alder Lake-P Thunderbolt 4 PCI Express Root Port #1 [8086:463f] (rev 02)
00:08.0 System peripheral [0880]: Intel Corporation 12th Gen Core Processor Gaussian & Neural Accelerator [8086:464f] (rev 02)
00:0d.0 USB controller [0c03]: Intel Corporation Alder Lake-P Thunderbolt 4 USB Controller [8086:461e] (rev 02)
00:0d.2 USB controller [0c03]: Intel Corporation Alder Lake-P Thunderbolt 4 NHI #0 [8086:463e] (rev 02)
00:12.0 Serial controller [0700]: Intel Corporation Alder Lake-P Integrated Sensor Hub [8086:51fc] (rev 01)
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.1 Serial bus controller [0c80]: Intel Corporation Alder Lake PCH Serial IO I2C Controller #1 [8086:51e9] (rev 01)
00:16.0 Communication controller [0780]: Intel Corporation Alder Lake PCH HECI Controller [8086:51e0] (rev 01)
00:1c.0 PCI bridge [0604]: Intel Corporation Alder Lake-P PCH PCIe Root Port #4 [8086:51bb] (rev 01)
00:1f.0 ISA bridge [0601]: Intel Corporation Alder Lake PCH eSPI Controller [8086:5182] (rev 01)
00:1f.3 Audio device [0403]: 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)
01:00.0 3D controller [0302]: NVIDIA Corporation GA107GLM [RTX A1000 Laptop GPU] [10de:25b9] (rev a1)
02:00.0 Non-Volatile memory controller [0108]: Samsung Electronics Co Ltd NVMe SSD Controller PM9A1/PM9A3/980PRO [144d:a80a]
a5:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5260 PCI Express Card Reader [10ec:5260] (rev 01)
```

View File

@@ -0,0 +1,37 @@
{
config,
lib,
...
}:
{
imports = [
../../../common/cpu/intel/alder-lake
../../../common/pc/laptop
../../../common/pc/ssd
../../../common/gpu/nvidia/prime.nix
];
hardware.intelgpu.driver = lib.mkIf (lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.8") "xe";
boot.kernelParams = lib.mkIf (config.hardware.intelgpu.driver == "xe") [
"i915.force_probe=!46a6"
"xe.force_probe=46a6"
];
hardware.nvidia = {
nvidiaSettings = lib.mkDefault true;
modesetting.enable = lib.mkDefault true;
open = lib.mkDefault false;
prime = {
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
};
# Override the Intel gpu driver setting imported above
environment.variables = {
VDPAU_DRIVER = lib.mkIf config.hardware.opengl.enable (lib.mkOverride 990 "nvidia");
};
services.thermald.enable = lib.mkDefault true;
}

View File

@@ -61,7 +61,10 @@ Then use `fwupdmgr` to perform updates
## Nvidia Driver
The choice of the `legacy_390` driver is based on looking for PCI Device ID `10de:1436`. On the [nvidia driver site](https://www.nvidia.com/en-us/drivers/unix/legacy-gpu/) which should indicate the
driver, the exact device isn't listed. However, we can see
[here](https://linux-hardware.org/?id=pci:10de-1436-103c-1909) has nvidia driver "375.82 and newer" listed. Since the
newest nvidia drivers don't support legacy devices, the closest version newer than 375.82 was chosen.
The choice of the `stable` driver is based on looking at the family of the card on [nouveau wiki's code names page](https://nouveau.freedesktop.org/CodeNames.html) obtained with:
```bash
$ lspci -k -d ::03xx
```
Both `Quadro M2200 Mobile (GM206GLM)` and `Quadro M1200 Mobile (GM107GLM)` belong to the **Maxwell** family which is still supported by the stable driver.

View File

@@ -32,7 +32,7 @@
enable32Bit = lib.mkDefault true;
};
nvidia = {
package = config.boot.kernelPackages.nvidiaPackages.legacy_390;
package = config.boot.kernelPackages.nvidiaPackages.stable;
nvidiaSettings = lib.mkDefault true;
modesetting.enable = lib.mkDefault true;
open = lib.mkDefault false;

View File

@@ -13,11 +13,8 @@
};
boot = {
# needs to be explicitly loaded or else bluetooth/wifi won't work
kernelModules = [
"kvm-intel"
"wl"
];
extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ];
};
}

22
flake.lock generated
View File

@@ -1,26 +1,6 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1751290770,
"narHash": "sha256-u4s8yKAqTzPGY3vTcDyAIet11uXaNCM//93/0O0NlbA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0620a50e9a847851bf802c59a4202552ed79b821",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-25.05-small",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
"root": {}
},
"root": "root",
"version": 7

View File

@@ -2,7 +2,39 @@
description = "nixos-hardware";
outputs =
{ ... }:
{ self, ... }:
let
# Import private inputs (for development)
privateInputs =
(import ./tests/flake-compat.nix {
src = ./tests;
}).defaultNix;
systems = [
"aarch64-linux"
"riscv64-linux"
"x86_64-linux"
];
formatSystems = [
"aarch64-linux"
"x86_64-linux"
"aarch64-darwin"
];
# Helper to iterate over systems
eachSystem =
f:
privateInputs.nixos-unstable-small.lib.genAttrs systems (
system: f privateInputs.nixos-unstable-small.legacyPackages.${system} system
);
eachSystemFormat =
f:
privateInputs.nixos-unstable-small.lib.genAttrs formatSystems (
system: f privateInputs.nixos-unstable-small.legacyPackages.${system} system
);
in
{
nixosModules =
@@ -20,12 +52,14 @@
apple-imac-18-2 = import ./apple/imac/18-2;
apple-macbook-air-3 = import ./apple/macbook-air/3;
apple-macbook-air-4 = import ./apple/macbook-air/4;
apple-macbook-air-5 = import ./apple/macbook-air/5;
apple-macbook-air-6 = import ./apple/macbook-air/6;
apple-macbook-air-7 = import ./apple/macbook-air/7;
apple-macbook-pro = import ./apple/macbook-pro;
apple-macbook-pro-8-1 = import ./apple/macbook-pro/8-1;
apple-macbook-pro-10-1 = import ./apple/macbook-pro/10-1;
apple-macbook-pro-11-1 = import ./apple/macbook-pro/11-1;
apple-macbook-pro-11-4 = import ./apple/macbook-pro/11-4;
apple-macbook-pro-11-5 = import ./apple/macbook-pro/11-5;
apple-macbook-pro-12-1 = import ./apple/macbook-pro/12-1;
apple-macbook-pro-14-1 = import ./apple/macbook-pro/14-1;
@@ -41,11 +75,14 @@
asus-flow-gv302x-amdgpu = import ./asus/flow/gv302x/amdgpu;
asus-flow-gv302x-nvidia = import ./asus/flow/gv302x/nvidia;
asus-pro-ws-x570-ace = import ./asus/pro-ws-x570-ace;
asus-rog-gl552vw = import ./asus/rog-gl552vw;
asus-rog-strix-g513im = import ./asus/rog-strix/g513im;
asus-rog-strix-g533zw = import ./asus/rog-strix/g533zw;
asus-rog-strix-g533q = import ./asus/rog-strix/g533q;
asus-rog-strix-g713ie = import ./asus/rog-strix/g713ie;
asus-rog-strix-g733qs = import ./asus/rog-strix/g733qs;
asus-rog-strix-x570e = import ./asus/rog-strix/x570e;
asus-zenbook-um6702 = import ./asus/zenbook/um6702;
asus-zenbook-ux371 = import ./asus/zenbook/ux371;
asus-zenbook-ux535 = import ./asus/zenbook/ux535;
asus-zenbook-ux481-intelgpu = import ./asus/zenbook/ux481/intelgpu;
@@ -92,6 +129,7 @@
dell-precision-5490 = import ./dell/precision/5490;
dell-precision-5530 = import ./dell/precision/5530;
dell-precision-5560 = import ./dell/precision/5560;
dell-precision-5570 = import ./dell/precision/5570;
dell-precision-7520 = import ./dell/precision/7520;
dell-xps-13-7390 = import ./dell/xps/13-7390;
dell-xps-13-9300 = import ./dell/xps/13-9300;
@@ -133,9 +171,12 @@
framework-13-7040-amd = import ./framework/13-inch/7040-amd;
framework-amd-ai-300-series = import ./framework/13-inch/amd-ai-300-series;
framework-16-7040-amd = import ./framework/16-inch/7040-amd;
framework-16-amd-ai-300-series = import ./framework/16-inch/amd-ai-300-series;
framework-desktop-amd-ai-max-300-series = import ./framework/desktop/amd-ai-max-300-series;
friendlyarm-nanopc-t4 = import ./friendlyarm/nanopc-t4;
friendlyarm-nanopi-r5s = import ./friendlyarm/nanopi-r5s;
focus-m2-gen1 = import ./focus/m2/gen1;
fydetab-duo = import ./fydetab/duo;
gigabyte-b550 = import ./gigabyte/b550;
gigabyte-b650 = import ./gigabyte/b650;
gmktec-nucbox-g3-plus = import ./gmktec/nucbox/g3-plus;
@@ -153,6 +194,7 @@
hp-elitebook-845g8 = import ./hp/elitebook/845/g8;
hp-elitebook-845g9 = import ./hp/elitebook/845/g9;
hp-probook-440G5 = import ./hp/probook/440G5;
hp-probook-460G11 = import ./hp/probook/460G11;
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;
@@ -165,11 +207,14 @@
lenovo-ideapad-15ach6 = import ./lenovo/ideapad/15ach6;
lenovo-ideapad-16ach6 = import ./lenovo/ideapad/16ach6;
lenovo-ideapad-16ahp9 = import ./lenovo/ideapad/16ahp9;
lenovo-ideapad-s5-16iah8 = import ./lenovo/ideapad/16iah8;
lenovo-ideapad-z510 = import ./lenovo/ideapad/z510;
lenovo-ideapad-slim-5 = import ./lenovo/ideapad/slim-5;
lenovo-ideapad-s145-15api = import ./lenovo/ideapad/s145-15api;
lenovo-legion-15ach6 = import ./lenovo/legion/15ach6;
lenovo-legion-15ach6h = import ./lenovo/legion/15ach6h;
lenovo-legion-15ach6h-hybrid = import ./lenovo/legion/15ach6h/hybrid;
lenovo-legion-15ach6h-nvidia = import ./lenovo/legion/15ach6h/nvidia;
lenovo-legion-15arh05h = import ./lenovo/legion/15arh05h;
lenovo-legion-16ach6h = import ./lenovo/legion/16ach6h;
lenovo-legion-16ach6h-hybrid = import ./lenovo/legion/16ach6h/hybrid;
@@ -180,6 +225,7 @@
lenovo-legion-16achg6-nvidia = import ./lenovo/legion/16achg6/nvidia;
lenovo-legion-16aph8 = import ./lenovo/legion/16aph8;
lenovo-legion-16arha7 = import ./lenovo/legion/16arha7;
lenovo-legion-16iah7h = import ./lenovo/legion/16iah7h;
lenovo-legion-16ithg6 = import ./lenovo/legion/16ithg6;
lenovo-legion-16irx8h = import ./lenovo/legion/16irx8h;
lenovo-legion-16irx9h = import ./lenovo/legion/16irx9h;
@@ -206,10 +252,12 @@
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-amd-gen5 = import ./lenovo/thinkpad/p14s/amd/gen5;
lenovo-thinkpad-p14s-intel-gen2 = import ./lenovo/thinkpad/p14s/intel/gen2;
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-p16s-amd-gen4 = import ./lenovo/thinkpad/p16s/amd/gen4;
lenovo-thinkpad-p16s-intel-gen2 = import ./lenovo/thinkpad/p16s/intel/gen2;
lenovo-thinkpad-p43s = import ./lenovo/thinkpad/p43s;
lenovo-thinkpad-p50 = import ./lenovo/thinkpad/p50;
@@ -222,6 +270,9 @@
lenovo-thinkpad-t14-amd-gen3 = import ./lenovo/thinkpad/t14/amd/gen3;
lenovo-thinkpad-t14-amd-gen4 = import ./lenovo/thinkpad/t14/amd/gen4;
lenovo-thinkpad-t14-amd-gen5 = import ./lenovo/thinkpad/t14/amd/gen5;
lenovo-thinkpad-t14-intel-gen1 = import ./lenovo/thinkpad/t14/intel/gen1;
lenovo-thinkpad-t14-intel-gen1-nvidia = import ./lenovo/thinkpad/t14/intel/gen1/nvidia;
lenovo-thinkpad-t14-intel-gen6 = import ./lenovo/thinkpad/t14/intel/gen6;
lenovo-thinkpad-t14s = import ./lenovo/thinkpad/t14s;
lenovo-thinkpad-t14s-amd-gen1 = import ./lenovo/thinkpad/t14s/amd/gen1;
lenovo-thinkpad-t14s-amd-gen4 = import ./lenovo/thinkpad/t14s/amd/gen4;
@@ -262,8 +313,8 @@
lenovo-thinkpad-x1-extreme-gen4 = import ./lenovo/thinkpad/x1-extreme/gen4;
lenovo-thinkpad-x1-nano = import ./lenovo/thinkpad/x1-nano;
lenovo-thinkpad-x1-nano-gen1 = import ./lenovo/thinkpad/x1-nano/gen1;
lenovo-thinkpad-x13 = import ./lenovo/thinkpad/x13/intel;
lenovo-thinkpad-x13-amd = import ./lenovo/thinkpad/x13/amd;
lenovo-thinkpad-x13-intel = import ./lenovo/thinkpad/x13/intel;
lenovo-thinkpad-x13-yoga = import ./lenovo/thinkpad/x13/yoga;
lenovo-thinkpad-x13-yoga-3th-gen = import ./lenovo/thinkpad/x13/yoga/3th-gen;
lenovo-thinkpad-x13s = import ./lenovo/thinkpad/x13s;
@@ -287,8 +338,11 @@
lenovo-yoga-7-14IAH7-hybrid = import ./lenovo/yoga/7/14IAH7/hybrid;
lenovo-yoga-7-14ILL10 = import ./lenovo/yoga/7/14ILL10;
lenovo-yoga-7-slim-gen8 = import ./lenovo/yoga/7/slim/gen8;
letsnote-cf-lx3 = import ./panasonic/letsnote/cf-lx3;
letsnote-cf-lx4 = import ./panasonic/letsnote/cf-lx4;
linglong-nova-studio = import ./linglong/nova-studio;
malibal-aon-s1-intel = import ./malibal/aon/s1;
mechrevo-gm5hg0a = import ./mechrevo/GM5HG0A;
microchip-icicle-kit = import ./microchip/icicle-kit;
microsoft-surface-go = import ./microsoft/surface/surface-go;
microsoft-surface-pro-intel = import ./microsoft/surface/surface-pro-intel;
@@ -298,15 +352,18 @@
microsoft-surface-pro-9 = import ./microsoft/surface-pro/9;
milkv-pioneer = import ./milkv/pioneer;
minisforum-v3 = import ./minisforum/v3;
mnt-reform-rk3588 = import ./mnt/reform/rk3588;
morefine-m600 = import ./morefine/m600;
msi-b350-tomahawk = import ./msi/b350-tomahawk;
msi-b550-a-pro = import ./msi/b550-a-pro;
msi-b550-tomahawk = import ./msi/b550-tomahawk;
msi-gs60 = import ./msi/gs60;
msi-gl62 = import ./msi/gl62;
msi-gl65-10SDR-492 = import ./msi/gl65/10SDR-492;
nxp-imx8mp-evk = import ./nxp/imx8mp-evk;
nxp-imx8mq-evk = import ./nxp/imx8mq-evk;
nxp-imx8qm-mek = import ./nxp/imx8qm-mek;
nxp-imx93-evk = import ./nxp/imx93-evk;
hardkernel-odroid-hc4 = import ./hardkernel/odroid-hc4;
hardkernel-odroid-h3 = import ./hardkernel/odroid-h3;
hardkernel-odroid-h4 = import ./hardkernel/odroid-h4;
@@ -355,6 +412,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-amd = import ./tuxedo/infinitybook/pro14/gen9/amd;
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;
@@ -394,5 +452,40 @@
common-pc-laptop-ssd = import ./common/pc/ssd;
common-pc-ssd = import ./common/pc/ssd;
};
# Add formatter for `nix fmt`
formatter = eachSystemFormat (
pkgs: _system:
(privateInputs.treefmt-nix.lib.evalModule pkgs ./tests/treefmt.nix).config.build.wrapper
);
# Add packages
packages = eachSystem (
pkgs: _system: {
run-tests = pkgs.callPackage ./tests/run-tests.nix {
inherit self;
};
}
);
# Add checks for `nix run .#run-tests`
checks = eachSystem (
pkgs: system:
let
treefmtEval = privateInputs.treefmt-nix.lib.evalModule pkgs ./tests/treefmt.nix;
nixosTests = import ./tests/nixos-tests.nix {
inherit
self
privateInputs
system
pkgs
;
};
in
pkgs.lib.optionalAttrs (self.formatter ? ${system}) {
formatting = treefmtEval.config.build.check self;
}
// nixosTests
);
};
}

View File

@@ -2,15 +2,12 @@
## Updating Firmware
First put enable `fwupd`
Everything is updateable through fwupd, so it's enabled by default.
```nix
services.fwupd.enable = true;
```
Then run
To get the latest firmware, run:
```sh
$ fwupdmgr refresh
$ fwupdmgr update
```

View File

@@ -4,4 +4,10 @@
../common
../../../common/cpu/intel
];
# If this module isn't built into the kernel, we need to make sure it loads
# before soc_button_array. Otherwise the tablet mode gpio doesn't work.
# If correctly loaded, dmesg should show
# input: gpio-keys as /devices/platform/INT33D3:00
boot.initrd.kernelModules = [ "pinctrl_tigerlake" ];
}

View File

@@ -16,4 +16,7 @@
# Needed for desktop environments to detect display orientation
hardware.sensor.iio.enable = lib.mkDefault true;
# Everything is updateable through fwupd
services.fwupd.enable = true;
}

View File

@@ -2,15 +2,12 @@
## Updating Firmware
First put enable `fwupd`
Everything is updateable through fwupd, so it's enabled by default.
```nix
services.fwupd.enable = true;
```
Then run
To get the latest firmware, run:
```sh
$ fwupdmgr refresh
$ fwupdmgr update
```

View File

@@ -14,7 +14,6 @@ in
../common/amd.nix
../../../common/cpu/amd/raphael/igpu.nix
];
options = {
hardware.framework.amd-7040.preventWakeOnAC = lib.mkOption {
type = lib.types.bool;
@@ -30,6 +29,8 @@ in
};
config = {
services.fwupd.enable = true;
# Workaround applied upstream in Linux >=6.7 (on BIOS 03.03)
# https://github.com/torvalds/linux/commit/a55bdad5dfd1efd4ed9ffe518897a21ca8e4e193
services.udev.extraRules =

View File

@@ -2,14 +2,13 @@
## Updating Firmware
First put enable `fwupd`
Everything is updateable through fwupd, so it's enabled by default.
```nix
services.fwupd.enable = true;
```
Then run
To get the latest firmware, run:
```sh
$ fwupdmgr refresh
$ fwupdmgr update
```
- [Latest Update](https://fwupd.org/lvfs/devices/work.frame.Laptop.RyzenAI300.BIOS.firmware)

View File

@@ -10,6 +10,17 @@
../common
../common/amd.nix
];
config.hardware.framework.laptop13.audioEnhancement.rawDeviceName =
config = {
# Everything is updateable through fwupd
services.fwupd.enable = true;
hardware.framework.laptop13.audioEnhancement.rawDeviceName =
lib.mkDefault "alsa_output.pci-0000_c1_00.6.analog-stereo";
# suspend works with 6.15
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.15") (
lib.mkDefault pkgs.linuxPackages_latest
);
};
}

View File

@@ -6,8 +6,7 @@
../../../common/gpu/amd
];
boot.kernelParams =
[
boot.kernelParams = [
# There seems to be an issue with panel self-refresh (PSR) that
# causes hangs for users.
#

View File

@@ -9,8 +9,7 @@
../../../common/cpu/intel
];
boot.kernelParams =
[
boot.kernelParams = [
# For Power consumption
# https://community.frame.work/t/linux-battery-life-tuning/6665/156
"nvme.noacpi=1"

View File

@@ -2,14 +2,13 @@
## Updating Firmware
First put enable `fwupd`
Everything is updateable through fwupd, so it's enabled by default.
```nix
services.fwupd.enable = true;
```
Then run
To get the latest firmware, run:
```sh
$ fwupdmgr refresh
$ fwupdmgr update
```
- [Latest Update](https://fwupd.org/lvfs/devices/work.frame.Laptop.MTL.BIOS.firmware)

View File

@@ -11,36 +11,15 @@
../common/intel.nix
];
# Everything is updateable through fwupd
services.fwupd.enable = true;
# 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;''
];
hardware.framework.laptop13.audioEnhancement.rawDeviceName =
lib.mkDefault "alsa_output.pci-0000_00_1f.3.analog-stereo";
}

View File

@@ -1,4 +1,14 @@
# [Framework Laptop 16](https://frame.work/)
## Updating Firmware
The Framework Laptop 16 uses LVFS, so it can be updated via fwupd; see https://wiki.nixos.org/wiki/Fwupd for details
Everything is updateable through fwupd, so it's enabled by default.
To get the latest firmware, run:
```sh
$ fwupdmgr refresh
$ fwupdmgr update
```
- [Latest Update](https://fwupd.org/lvfs/devices/work.frame.Laptop16.Ryzen7040.BIOS.firmware)

View File

@@ -12,4 +12,6 @@
../../../common/cpu/amd/raphael/igpu.nix
];
# Everything is updateable through fwupd
services.fwupd.enable = true;
}

View File

@@ -0,0 +1,25 @@
# [Framework Laptop 16 AMD AI 300 Series](https://frame.work/)
## nvidia
If you have an nvidia dGPU module, you can enable it via the nvidia open drivers:
```
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia.open = true; # see the note above
```
See also [NVIDIA](https://wiki.nixos.org/wiki/NVIDIA) on the NixOS Wiki.
## Updating Firmware
Everything is updateable through fwupd, so it's enabled by default.
To get the latest firmware, run:
```sh
$ fwupdmgr refresh
$ fwupdmgr update
```
- [Latest Update](https://fwupd.org/lvfs/devices/work.frame.Laptop16.RyzenAI300.BIOS.firmware)

View File

@@ -0,0 +1,21 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [
../common
../common/amd.nix
];
# 6.14 is the minimum recommended kernel, 6.15 has many useful changes, too
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.15") (
lib.mkDefault pkgs.linuxPackages_latest
);
# Everything is updateable through fwupd
services.fwupd.enable = true;
}

View File

@@ -6,8 +6,7 @@
../../../common/gpu/amd
];
boot.kernelParams =
[
boot.kernelParams = [
# There seems to be an issue with panel self-refresh (PSR) that
# causes hangs for users.
#

View File

@@ -8,12 +8,6 @@
../../framework-tool.nix
];
# Fix TRRS headphones missing a mic
# https://community.frame.work/t/headset-microphone-on-linux/12387/3
boot.extraModprobeConfig = lib.mkIf (lib.versionOlder config.boot.kernelPackages.kernel.version "6.6.8") ''
options snd-hda-intel model=dell-headset-multi
'';
# For fingerprint support
services.fprintd.enable = lib.mkDefault true;
@@ -50,4 +44,7 @@
MatchDMIModalias=dmi:*svnFramework:pnLaptop16*
AttrKeyboardIntegration=internal
'';
# Everything is updateable through fwupd
services.fwupd.enable = true;
}

View File

@@ -0,0 +1,23 @@
# [Framework Desktop](https://frame.work/desktop)
## Kernel version
The recommended version is 6.15 or newer, it has good GPU and also EC firmware support (for sensors and ARGB).
The lowest recommended version is 6.14. It has good GPU support already.
The absolute lowest that runs okay on headless systems is 6.11, but the GPU is not fully supported yet.
## Updating Firmware
First put enable `fwupd`
```nix
services.fwupd.enable = true;
```
Then run
```sh
$ fwupdmgr update
```
- [Latest Update](https://fwupd.org/lvfs/devices/work.frame.Desktop.RyzenAIMax300.BIOS.firmware)

View File

@@ -0,0 +1,20 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [
../../../common/cpu/amd
../../../common/cpu/amd/pstate.nix
../../../common/gpu/amd
../../../common/pc/ssd
../../framework-tool.nix
];
# 6.14 and above have good GPU support
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.14") (
lib.mkDefault pkgs.linuxPackages_latest
);
}

View File

@@ -1,22 +1,26 @@
{
config,
lib,
pkgs,
...
}:
let
kernel_version_compatible = lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.10";
in
{
options.hardware.framework.enableKmod =
(lib.mkEnableOption "Enable the community created Framework kernel module that allows interacting with the embedded controller from sysfs.")
(lib.mkEnableOption "the community-created Framework kernel module that allows interacting with the embedded controller from sysfs.")
// {
# enable by default on NixOS >= 24.05 and kernel >= 6.10
default = lib.and (lib.versionAtLeast (lib.versions.majorMinor lib.version) "24.05") kernel_version_compatible;
defaultText = "enabled by default on NixOS >= 24.05 and kernel >= 6.10";
default = lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.10";
defaultText = "enabled by default if kernel >= 6.10";
};
config.boot = lib.mkIf config.hardware.framework.enableKmod {
config = lib.mkIf config.hardware.framework.enableKmod {
assertions = [
{
assertion = lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.10";
message = "The framework laptop kernel module requires Linux 6.10 or above";
}
];
boot = {
extraModulePackages = with config.boot.kernelPackages; [
framework-laptop-kmod
];
@@ -26,31 +30,6 @@ in
"cros_ec"
"cros_ec_lpcs"
];
# add required patch if enabled on kernel <6.10
kernelPatches = lib.mkIf (!kernel_version_compatible) [
rec {
name = "platform/chrome: cros_ec_lpc: add support for AMD Framework Laptops";
msgid = "20240403004713.130365-1-dustin@howett.net";
version = "3";
hash = "sha256-aQSyys8CMzlj9EdNhg8vtp76fg1qEwUVeJL0E+8w5HU=";
patch =
pkgs.runCommandLocal "patch-${msgid}"
{
nativeBuildInputs = with pkgs; [
b4
git
cacert
];
SSL_CERT_FILE = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
outputHash = hash;
}
''
export HOME="$TMP"
PYTHONHASHSEED=0 ${pkgs.b4}/bin/b4 -n am -C -T -v ${version} -o- "${msgid}" > "$out"
'';
}
];
};
};
}

19
fydetab/duo/README.md Normal file
View File

@@ -0,0 +1,19 @@
# Fydetab Duo
The Fydetab Duo is an open source and hackable tablet by FydeOS.
## Features
- Display: **works**
- X11: **untested**
- Wayland: **not working** (niri, sway, COSMIC)
- GPU driver: **not working**
- WiFi: **working**
- Cellular: **untested**
- SD card: **untested**
- Sound: **untested**
- Fingerprint: **untested**
## Flashing
Flashing requires `rkdeveloptool` and using it to write the new bootloader and eMMC image. To flash, press and hold the mask rom button on the board. Ensure a USB C cable is already plugged into the host computer. Run `nix build .#nixosConfigurations.<hostname>.config.hardware.rockchip.platformFirmware` and then use `rkdeveloptool ul result/rk3588_spl_loader_v1.18.113.bin`. The NixOS image can then be downloaded using `rkdeveloptool wl 0`, it is recommended to use the disko image configuration which is provided.

43
fydetab/duo/ap6275p.nix Normal file
View File

@@ -0,0 +1,43 @@
{
lib,
stdenv,
fetchFromGitHub,
}:
stdenv.mkDerivation (_finalAttrs: {
pname = "ap6275p-firmware";
version = "2023-11-05";
src = fetchFromGitHub {
owner = "Joshua-Riek";
repo = "firmware";
rev = "621ac45f5d931522bc08b51b995b938778973d2a";
hash = "sha256-ksAOxZTnEka9SirHYxroLMbKi+99FY72X2z1pJhgYnY=";
};
compressFirmware = false;
dontConfigure = true;
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out/lib/firmware/ap6275p
install -m644 ap6275p/BCM4362A2.hcd $out/lib/firmware/ap6275p/
install -m644 ap6275p/clm_bcm43752a2_pcie_ag.blob $out/lib/firmware/ap6275p/
install -m644 ap6275p/fw_bcm43752a2_pcie_ag.bin $out/lib/firmware/ap6275p/
install -m644 ap6275p/nvram_AP6275P.txt $out/lib/firmware/ap6275p/
install -m644 ap6275p/config.txt $out/lib/firmware/ap6275p/
mv $out/lib/firmware/ap6275p/nvram_AP6275P.txt $out/lib/firmware/ap6275p/nvram_ap6275p.txt
mv $out/lib/firmware/ap6275p/config.txt $out/lib/firmware/ap6275p/config_bcm43752a2_pcie_ag.txt
runHook postInstall
'';
meta = {
description = "Firmware for the AP6275P WiFi/Bluetooth module";
homepage = "https://github.com/Joshua-Riek/firmware";
license = lib.licenses.unfree;
};
})

View File

@@ -0,0 +1,44 @@
{
lib,
stdenv,
fetchurl,
autoPatchelfHook,
}:
stdenv.mkDerivation (_finalAttrs: {
pname = "brcm-patchram-plus";
version = "2024-08-23";
src = fetchurl {
url = "https://github.com/Linux-for-Fydetab-Duo/pkgbuilds/raw/fd5ebe4914f32c5a1c4fc15b4fb5a62bad2da1ea/fydetabduo-post-install/brcm_patchram_plus";
hash = "sha256-fZ1ximZcosZDYbveEkyMnasLWpcifaZ5CKz7QKtqKZQ=";
};
nativeBuildInputs = [
autoPatchelfHook
];
unpackPhase = ''
runHook preUnpack
cp --no-preserve=ownership,mode $src brcm_patchram_plus
chmod +x brcm_patchram_plus
runHook postUnpack
'';
dontConfigure = true;
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp brcm_patchram_plus $out/bin
autoPatchelf $out/bin/brcm_patchram_plus
runHook postInstall
'';
meta = {
license = lib.licenses.unfree;
mainProgram = "brcm_patchram_plus";
};
})

9549
fydetab/duo/config Normal file

File diff suppressed because it is too large Load Diff

28
fydetab/duo/config.nix Normal file
View File

@@ -0,0 +1,28 @@
{
CONFIG_DEVTMPFS = "y";
CONFIG_CGROUPS = "y";
CONFIG_INOTIFY_USER = "y";
CONFIG_SIGNALFD = "y";
CONFIG_TIMERFD = "y";
CONFIG_EPOLL = "y";
CONFIG_SYSFS = "y";
CONFIG_PROC_FS = "y";
CONFIG_FHANDLE = "y";
CONFIG_CRYPTO_USER_API_HASH = "y";
CONFIG_CRYPTO_HMAC = "y";
CONFIG_CRYPTO_SHA256 = "y";
CONFIG_DMIID = "y";
CONFIG_AUTOFS_FS = "y";
CONFIG_TMPFS_POSIX_ACL = "y";
CONFIG_TMPFS_XATTR = "y";
CONFIG_SECCOMP = "y";
CONFIG_TMPFS = "y";
CONFIG_BLK_DEV_INITRD = "y";
CONFIG_EFI_STUB = "y";
CONFIG_MODULES = "y";
CONFIG_BINFMT_ELF = "y";
CONFIG_UNIX = "y";
CONFIG_NET = "y";
CONFIG_IP_NF_MATCH_RPFILTER = "m";
CONFIG_ATA_PIIX = "m";
}

141
fydetab/duo/default.nix Normal file
View File

@@ -0,0 +1,141 @@
{
config,
pkgs,
lib,
...
}:
let
ap6275pFirmware = pkgs.callPackage ./ap6275p.nix { };
in
{
imports = [
../../rockchip
];
options.hardware.fydetab.duo = {
enablePanthor = lib.mkEnableOption "Panthor GPU driver";
};
config = {
boot = lib.mkMerge [
{
initrd.includeDefaultModules = false;
kernelPackages = pkgs.callPackage ./kernel.nix { };
extraModprobeConfig = ''
options bcmdhd firmware_path=${ap6275pFirmware}/lib/firmware/ap6275p/fw_bcm43752a2_pcie_ag.bin nvram_path=${ap6275pFirmware}/lib/firmware/ap6275p/nvram_AP6275P.txt conf_path=${ap6275pFirmware}/lib/firmware/ap6275p/config.txt
'';
kernelParams = [
"console=ttyFIQ0"
"console=tty1"
"console=both"
"earlycon=uart8250,mmio32,0xfeb50000"
];
kernelModules = [
"himax_tp"
"mh248-fyde"
"hci_uart"
];
}
(lib.mkIf config.hardware.bluetooth.enable {
kernelModules = [
"bluetooth"
];
})
];
hardware = lib.mkMerge [
{
deviceTree = lib.mkMerge [
{
name = "rockchip/rk3588s-fydetab-duo.dtb";
}
(lib.mkIf config.hardware.fydetab.duo.enablePanthor {
overlays = [
{
name = "fydetab-panthor-gpu";
dtsText = ''
/dts-v1/;
/plugin/;
#include <dt-bindings/clock/rk3588-cru.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/power/rk3588-power.h>
/ {
compatible = "rockchip,rk3588s-tablet-12c-linux";
fragment@0 {
target = <&gpu>;
__overlay__ {
status = "disabled";
};
};
fragment@1 {
target = <&gpu_panthor>;
__overlay__ {
status = "okay";
mali-supply = <&vdd_gpu_s0>;
};
};
};
'';
}
];
})
];
rockchip = {
rk3588.enable = true;
platformFirmware = pkgs.callPackage ./u-boot.nix { };
};
}
(lib.mkIf config.networking.wireless.iwd.enable {
firmware = [
# Only iwd is supported by the interface
ap6275pFirmware
];
})
(lib.mkIf config.hardware.graphics.enable {
firmware = [
(pkgs.callPackage ./mali-g610.nix { })
];
})
(lib.mkIf config.hardware.sensor.iio.enable {
firmware = [
(pkgs.callPackage ./himax.nix { })
];
})
];
systemd.services.bluetooth-fydetab = lib.mkIf config.hardware.bluetooth.enable {
description = "FydeTab Duo Bluetooth fix";
wantedBy = [ "multi-user.target" ];
serviceConfig.Type = "simple";
script = ''
${lib.getExe' pkgs.util-linux "rfkill"} block 0
${lib.getExe' pkgs.util-linux "rfkill"} block bluetooth
sleep 2
${lib.getExe' pkgs.util-linux "rfkill"} unblock 0
${lib.getExe' pkgs.util-linux "rfkill"} unblock bluetooth
sleep 1
${
lib.getExe (pkgs.callPackage ./brcm-patchram.nix { })
} --enable_hci --no2bytes --use_baudrate_for_download --tosleep 200000 --baudrate 1500000 --patchram ${ap6275pFirmware}/lib/firmware/ap6275p/BCM4362A2.hcd /dev/ttyS9
'';
};
services.udev = {
extraHwdb = ''
# Fydetab
evdev:input:b0018v0000p0000e0000*
EVDEV_ABS_00=::265
EVDEV_ABS_01=::166
'';
extraRules = ''
SUBSYSTEM=="iio" ATTR{name}=="lis2dw12" ENV{ACCEL_MOUNT_MATRIX}="1,0,0;0,-1,0;0,0,1"
SUBSYSTEM=="input", ENV{ID_INPUT_TABLET}=="1", ENV{LIBINPUT_CALIBRATION_MATRIX}="0 1 0 -1 0 1 0 0 1"
'';
};
};
}

35
fydetab/duo/himax.nix Normal file
View File

@@ -0,0 +1,35 @@
{
stdenv,
fetchurl,
lib,
}:
stdenv.mkDerivation (_finalAttrs: {
pname = "himax-firmware";
version = "2024-11-09";
src = fetchurl {
url = "https://github.com/Linux-for-Fydetab-Duo/pkgbuilds/raw/f4c012bd42d87f677370f987f703982d53cd233d/fydetabduo-post-install/Himax_firmware.bin";
hash = "sha256-z0p/zXcNTBdhKCV6GmM2C8C02lu4Wkb2HP+Ir/nQJTc=";
};
compressFirmware = false;
dontUnpack = true;
dontConfigure = true;
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out/lib/firmware
cp --no-preserve=ownership,mode $src $out/lib/firmware/Himax_firmware.bin
ls -ahl $out/lib/firmware
runHook postInstall
'';
meta = {
description = "Himax sensor firmware";
license = lib.licenses.unfree;
};
})

18
fydetab/duo/kernel.nix Normal file
View File

@@ -0,0 +1,18 @@
{
linuxPackagesFor,
linuxManualConfig,
fetchFromGitHub,
}:
linuxPackagesFor (linuxManualConfig rec {
version = "6.1.75";
modDirVersion = version;
src = fetchFromGitHub {
owner = "Linux-for-Fydetab-Duo";
repo = "linux-rockchip";
rev = "74a1657bc526e336ff66add2fa83a0522957c4cb";
hash = "sha256-Q0uCxebYw3c5Z/ZxCmTNyEfuYQQcPaw5qpvRTSWdtVo=";
};
configfile = ./config;
config = import ./config.nix;
features.netfilterRPFilter = true;
})

35
fydetab/duo/mali-g610.nix Normal file
View File

@@ -0,0 +1,35 @@
{
stdenv,
fetchurl,
lib,
}:
stdenv.mkDerivation (_finalAttrs: {
pname = "mali-g610-firmware";
version = "2024-08-23";
src = fetchurl {
url = "https://github.com/Linux-for-Fydetab-Duo/pkgbuilds/raw/f4c012bd42d87f677370f987f703982d53cd233d/mali-G610-firmware-rkr4/mali_csffw.bin";
hash = "sha256-Ei8ezBTS3g/pP8Al+Md+RTGr0AT6Fy/+aeQM19FdXGY=";
};
compressFirmware = false;
dontUnpack = true;
dontConfigure = true;
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out/lib/firmware
cp --no-preserve=ownership,mode $src $out/lib/firmware/mali_csffw.bin
ls -ahl $out/lib/firmware
runHook postInstall
'';
meta = {
description = "Mali G610 firmware for Rockchip RK3588(S) using the rkr4 kernel or later";
license = lib.licenses.unfree;
};
})

99
fydetab/duo/u-boot.nix Normal file
View File

@@ -0,0 +1,99 @@
{
lib,
stdenv,
buildUBoot,
armTrustedFirmwareRK3588,
rkbin,
fetchpatch,
fetchurl,
fetchFromGitHub,
}:
buildUBoot {
defconfig = "rk3588s_fydetab_duo_defconfig";
extraMeta.platforms = [ "aarch64-linux" ];
BL31 = "${armTrustedFirmwareRK3588}/bl31.elf";
ROCKCHIP_TPL = rkbin.TPL_RK3588;
CROSS_COMPILE_ARM64 = "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}";
INI_LOADER = fetchurl {
url = "https://github.com/rockchip-linux/rkbin/raw/${rkbin.src.rev}/RKBOOT/RK3588MINIALL.ini";
hash = "sha256-87Vt6nXVt+jRrRatOlwGJXYqSj9nJz1LUfQnviIVb7I=";
};
version = "5.10.0";
filesToInstall = [
"idbloader.img"
"u-boot.itb"
"rk3588_spl_loader_v1.18.113.bin"
"tools/resource_tool"
];
NIX_CFLAGS_COMPILE = "-Wno-error=enum-int-mismatch -Wno-error=maybe-uninitialized";
extraMakeFlags = [
"CROSS_COMPILE_ARM64=${stdenv.cc.targetPrefix}"
];
extraPatches =
lib.attrValues (
lib.mapAttrs
(
name: hash:
fetchpatch {
url = "https://github.com/openFyde/overlay-fydetab_duo-openfyde/raw/fd84c5302908dea6a819c2dcd025a2bf93b5d4e8/sys-boot/rk-uboot/files/rk8/${name}";
inherit hash;
}
)
{
"001-add-avdd-avee-in-rockchip_panel.patch" = "sha256-qmBdmSejcDn4ulvOTLjfBsNh6nl12sbobtX4mhTMMKY=";
"002-add-fydetab-support.patch" = "sha256-QlnhdkoOQcGxRiIOx1jNqDLb/abB/+l+hAQ8vKCpwOw=";
"003-match-display-config-with-kernel.patch" =
"sha256-hmICiAgYjjBryJIuNXOffiYTssKSaV1cDeSgRTdq51k=";
"004-enable-sdcard-for-fydetab.patch" = "sha256-xrZ1kuije6X+huvarDIGFhMy2Puq0XvlKa1ZfgGcwlQ=";
"005-display-logo-on-loader-mode.patch" = "sha256-NMQHJMl8s1NUrDSnUX8gAmSNaurBU+m0xKd4TtEPmz4=";
"006-update-deconfig.patch" = "sha256-ZukJEZjEFaN6F4+3VnHfkfdaOTQmkw3fdClk8OeOYRw=";
"007-add-deinit-after-show-bmp-add-ums-mode.patch" =
"sha256-4pHV+qiXMNHcIlC1ciFQsejVZvdnEhfs7QBbge9kHoM=";
"008-add-charging-mode.patch" = "sha256-AToALdx5mwyQ875ZnrpqbuUE9oGonH76RaUq6757U1E=";
"009-set-lowpower-to-3.patch" = "sha256-CYYmY8vQcOIiA3QPvZt+AgI/BbkykoKGqLECim7kAyw=";
"010-fix-compiling-issue.patch" = "sha256-hmiFFe0JuxXMPgeQFWI8qZop+VPmldxgs0Wowchswbs=";
"011-fix-battery-temp.patch" = "sha256-MXe5FGzGETZ3wpW7ur5rBLysdNlDMwiq7/LNxdDpA0E=";
"012-fix-make.patch" = "sha256-/8ZfhB04R4zIddOXJEx8GcnYoljYsGolbt/oQYsm/Xk=";
"013-change-exit-charge-level.patch" = "sha256-84zy5yzoHyAutVmbCvvB5t4uJFQGsMt3jTUgVs5SIog=";
"014-fix-spl-sdcard-issue.patch" = "sha256-jIHybAm9XKDbWF3xG4E9K8x2j5nfpHOp6/2gWDlQ6aU=";
}
)
++ [
./uboot-remove-sig-req.patch
];
src = fetchFromGitHub {
owner = "rockchip-linux";
repo = "u-boot";
rev = "63c55618fbdc36333db4cf12f7d6a28f0a178017";
hash = "sha256-OZmR6BLwCMK6lq9qmetIdrjSJJWcx7Po1OE9dBWL+Ew=";
};
extraConfig = ''
CONFIG_FIT_SIGNATURE=n
CONFIG_TPL_BUILD=y
CONFIG_SPL_FIT_SIGNATURE=n
CONFIG_SPL_FIT_ROLLBACK_PROTECT=n
CONFIG_CMD_FDT=y
CONFIG_DEFAULT_FDT_FILE="rk3588s-fydetab-duo.dtb"
CONFIG_CMD_PXE=y
'';
preBuild = ''
patchShebangs arch/arm/mach-rockchip/make_fit_atf.sh
patchShebangs arch/arm/mach-rockchip/decode_bl31.py
# Needs write access to generate the spl
cp -r ${rkbin.src} rkbin
chmod -R u+rw rkbin
export RKBIN_TOOLS=$(readlink -e rkbin/tools)
ln -s ${rkbin}/bin bin
cp ${rkbin.src}/tools/boot_merger tools/
cp ${rkbin.src}/tools/mkimage tools/
'';
postBuild = ''
sh ./make.sh --spl
sh ./make.sh --idblock
sh ./make.sh itb
mv idblock.bin idbloader.img
'';
}

View File

@@ -0,0 +1,11 @@
--- a/tools/Makefile 2025-08-17 22:31:27.653078358 -0700
+++ b/tools/Makefile 2025-08-17 22:30:09.551827481 -0700
@@ -54,7 +54,7 @@
hostprogs-y += mkenvimage
mkenvimage-objs := mkenvimage.o os_support.o lib/crc32.o
-hostprogs-y += dumpimage mkimage
+hostprogs-$(CONFIG_FIT_SIGNATURE) += dumpimage mkimage
hostprogs-$(CONFIG_FIT_SIGNATURE) += fit_info fit_check_sign
# Rockchip pack tools

View File

@@ -0,0 +1,14 @@
{ config, lib, ... }:
{
imports = [
../../../common/cpu/intel/meteor-lake
../../../common/pc
../../../common/pc/laptop
../../../common/pc/ssd
];
config = {
services.thermald.enable = lib.mkDefault true;
};
}

View File

@@ -10,8 +10,7 @@
# remove all packages for amd igpu. I only removed amdgpu from
# services.xserver.videoDrivers by overriding. This is because the specialization
# of nix cannot implement such an operation as canceling an import.
hardware =
{
hardware = {
nvidia.prime.offload.enable = false;
}
// lib.optionalAttrs (options ? amdgpu.opencl.enable) {

View File

@@ -10,8 +10,7 @@
# remove all packages for amd igpu. I only removed amdgpu from
# services.xserver.videoDrivers by overriding. This is because the specialization
# of nix cannot implement such an operation as canceling an import.
hardware =
{
hardware = {
nvidia.prime.offload.enable = false;
}
// lib.optionalAttrs (options ? amdgpu.opencl.enable) {

View File

@@ -3,8 +3,7 @@
{
imports = [ ../hybrid ];
services.xserver.videoDrivers = [ "nvidia" ];
hardware =
{
hardware = {
nvidia.prime.offload.enable = false;
}
// lib.optionalAttrs (options ? amdgpu.opencl.enable) {

View File

@@ -14,8 +14,9 @@
# amdgpu.backlight=0 makes the backlight work
# acpi_backlight=none allows the backlight save/load systemd service to work on older kernel versions
boot.kernelParams =
[ "amdgpu.backlight=0" ]
boot.kernelParams = [
"amdgpu.backlight=0"
]
++ lib.optional (lib.versionOlder config.boot.kernelPackages.kernel.version "6.1.6") "acpi_backlight=none";
# For mainline support of rtw89 wireless networking

View File

@@ -0,0 +1,7 @@
# Lenovo ThinkPad P14s Intel Gen 2
Much of the extraneous settings are filled out using the [wiki](https://wiki.nixos.org/wiki/NVIDIA#Hybrid_graphics_with_PRIME), which gives guidance on how to determine the correct PCI bus IDs to assign, aswell as the note to include the `modesetting` driver in `services.xserver.videoDrivers`.
## BIOS Settings to adjust
For suspending to RAM to work, set Config -> Power -> Sleep State to "Linux S3" in EFI.

View File

@@ -0,0 +1,18 @@
{
imports = [
../../../../../common/gpu/nvidia/prime.nix
../../../../../common/gpu/nvidia/turing
../../../../../common/cpu/intel/tiger-lake
../../../../../common/pc/laptop
../../../../../common/pc/ssd
../../../../../common/pc
../.
];
hardware.nvidia.prime = {
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
services.xserver.videoDrivers = [ "modesetting" ];
}

View File

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

View File

@@ -0,0 +1,9 @@
{ lib, pkgs, ... }:
{
imports = [
../.
../../../../common/cpu/intel
../../../../common/gpu/intel
];
}

View File

@@ -0,0 +1,8 @@
{ lib, config, ... }:
{
imports = [
../../../../../common/cpu/intel/comet-lake
../.
];
}

View File

@@ -0,0 +1,28 @@
{ lib, config, ... }:
{
imports = [
../../../../../../common/gpu/nvidia/pascal
../../../../../../common/gpu/nvidia/prime-sync.nix
../.
];
hardware = {
graphics = {
enable = lib.mkDefault true;
enable32Bit = lib.mkDefault true;
};
nvidia = {
powerManagement.enable = lib.mkDefault true;
modesetting.enable = lib.mkDefault true;
dynamicBoost.enable = lib.mkForce false; # Dynamic boost is not supported on Pascal architeture
prime = {
# 00:02.0 VGA compatible controller: Intel Corporation CometLake-U GT2 [UHD Graphics] (rev 02)
intelBusId = lib.mkDefault "PCI:0:2:0";
# 2d:00.0 3D controller: NVIDIA Corporation GP108M [GeForce MX330] (rev a1)
nvidiaBusId = lib.mkDefault "PCI:45:0:0";
};
};
};
services.thermald.enable = lib.mkDefault true;
}

View File

@@ -0,0 +1,60 @@
{
lib,
pkgs,
config,
...
}:
{
imports = [
../../.
../../../../../common/cpu/intel/lunar-lake
];
# T14 Gen 6 uses Intel Core Ultra processors (Lunar Lake architecture)
# with integrated Intel Arc graphics
# The lunar-lake module already includes appropriate GPU support
# Ensure modern kernel for full Lunar Lake support
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.8") pkgs.linuxPackages_latest;
# TODO: Looking for feedback on these kernel parameters for T14 Gen 6
# Force use of the thinkpad_acpi driver for backlight control
# This allows the backlight save/load systemd service to work
boot.kernelParams = [
"acpi_backlight=native"
# TODO: Looking for feedback - touchpad fix needed for proper click registration on some T14 models
"psmouse.synaptics_intertouch=0"
];
# TODO: Looking for feedback - modern Intel CPUs don't typically need throttled service
# which can interfere with newer power management on Lunar Lake
services.throttled.enable = lib.mkDefault false;
# Enable fingerprint reader support
# NOTE: PAM configuration should be done in host config to avoid login issues
# See: https://github.com/NixOS/nixpkgs/issues/171136
services.fprintd.enable = lib.mkDefault true;
# For complete fingerprint authentication in GNOME, add the following to your host config:
#
# security.pam.services = {
# # Enable fingerprint authentication for sudo
# sudo.fprintAuth = lib.mkDefault true;
#
# # Enable fingerprint authentication for su
# su.fprintAuth = lib.mkDefault true;
#
# # Enable fingerprint authentication for screen unlock
# xscreensaver.fprintAuth = lib.mkDefault true;
#
# # WARNING: login.fprintAuth may break GDM password authentication
# # Only enable if you understand the risks:
# # login.fprintAuth = lib.mkDefault true;
# };
#
# After configuration:
# 1. Rebuild your system
# 2. Enroll fingerprint: sudo fprintd-enroll $USER
# 3. Test sudo and screen unlock with fingerprint
}

View File

@@ -2,6 +2,12 @@
imports = [
../.
../../../../common/pc/ssd
../../../../common/cpu/intel/meteor-lake
];
boot.kernelParams = [
"i915.enable_guc=3"
"i915.force_probe=7d55"
];
hardware.trackpoint.device = "TPPS/2 Synaptics TrackPoint";

View File

@@ -6,8 +6,8 @@
../../../../common/pc/ssd
];
# touchpad, wifi, and bluetooth do not work before 6.12
config.boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.12") (
# device will not boot in kernel versions older than 6.15
config.boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.15") (
lib.mkDefault pkgs.linuxPackages_latest
);
}

View File

@@ -0,0 +1,39 @@
# Linglong Nova Studio
This is a configuration for [Linglong Nova Studio (玲珑星核)](https://www.firstarpc.com/).
## Configuration
import `<nixos-hardware/linglong/nova-studio>` (using configurations), or add `nixos-hardware.nixosModules.linglong-nova-studio` in modules (using Flakes).
This configuration will force to use Linux kernel that >= 6.14, otherwise it will be updated to the latest version. This part follows [Framework Desktop](../../framework/desktop/amd-ai-max-300-series), which is also a desktop computer using Ryzen AI Max 300 series processor.
## OpenCL and ROCm support
To setup OpenCL and ROCm environment, please add the following configuration:
```
# Tell packages that supports ROCm to enable the related supports.
nixpkgs.config.rocmSupport = true;
# Install ROCm and enable
hardware.amdgpu.opencl.enable = true;
# These tools can show the info related to ROCm and OpenCL.
environment.systemPackages = with pkgs; [
rocmPackages.rocminfo
clinfo
];
```
After switching, to check whether the environment has been correctly setup, please run
```
clinfo
```
and
```
rocminfo
```

View File

@@ -0,0 +1,25 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [
../../common/cpu/amd
../../common/cpu/amd/pstate.nix
../../common/cpu/amd/zenpower.nix
../../common/gpu/amd
../../common/pc/ssd
];
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.14") (
lib.mkDefault pkgs.linuxPackages_latest
);
boot.kernelModules = [ "amdgpu" ];
hardware.enableRedistributableFirmware = lib.mkDefault true;
hardware.graphics.enable = lib.mkDefault true;
hardware.graphics.enable32Bit = lib.mkDefault true;
}

View File

@@ -0,0 +1,35 @@
{
lib,
pkgs,
config,
...
}:
{
imports = [
../../common/cpu/amd
../../common/cpu/amd/pstate.nix
../../common/cpu/amd/zenpower.nix
../../common/cpu/amd/raphael/igpu.nix
../../common/gpu/amd
../../common/gpu/nvidia
../../common/gpu/nvidia/ada-lovelace
../../common/gpu/nvidia/prime.nix
../../common/hidpi.nix
../../common/pc/laptop
../../common/pc/ssd
];
# Resolve the issue of sleep mode being awakened by GPIO 6.
# https://nova.gal/blog/%E6%9C%BA%E6%A2%B0%E9%9D%A9%E5%91%BD%E7%BF%BC%E9%BE%99-15Pro-%E8%BF%81%E7%A7%BB-Linux-%E9%81%87%E5%88%B0%E7%9A%84%E4%B8%80%E4%BA%9B%E9%97%AE%E9%A2%98#%E6%97%A0%E6%B3%95%E4%BC%91%E7%9C%A0
# https://lore.kernel.org/all/20221012221028.4817-1-mario.limonciello@amd.com/T/
boot.kernelParams = [ "gpiolib_acpi.ignore_interrupt=AMDI0030:00@6" ];
hardware.nvidia = {
primeBatterySaverSpecialisation = lib.mkDefault true;
modesetting.enable = lib.mkDefault true;
prime = {
amdgpuBusId = "PCI:6:0:0";
nvidiaBusId = "PCI:1:0:0";
};
};
}

View File

@@ -103,6 +103,23 @@ with the `ath10k` QCA6174 Wifi device.
This was fixed in Nov 2021:
- https://github.com/linux-surface/linux-surface/issues/542#issuecomment-976995453
## Troubleshooting IPU6
While the camera patches are applied in `common`, camera functionality is still WIP for several devices (see [https://github.com/linux-surface/linux-surface/wiki/Camera-Support](https://github.com/linux-surface/linux-surface/wiki/Camera-Support)). As a result they may break some userspace tools on unsupported devices, notably such as Wireplumber. An example fix for such userspace issues is shown below.
```
services.pipewire.wireplumber.extraConfig = {
"50-surface-disable-libcamera.conf" = ''
monitor.libcamera = { enabled = false }
wireplumber.profiles = {
main = {
monitor.libcamera = disabled
hardware.video-capture = disabled
}
}
'';
};
```
### Background:
With the older firmware, you would see messages like "Can't ping firmware".

View File

@@ -19,7 +19,7 @@ let
if kernelVersion == "longterm" then
"6.12.19"
else if kernelVersion == "stable" then
"6.15.6"
"6.15.9"
else
abort "Invalid kernel version: ${kernelVersion}";
@@ -28,7 +28,7 @@ let
if kernelVersion == "longterm" then
"sha256-1zvwV77ARDSxadG2FkGTb30Ml865I6KB8y413U3MZTE="
else if kernelVersion == "stable" then
"sha256-K7WGyVQnfQcMj99tcnX6qTtIB9m/M1O0kdgUnMoCtPw="
"sha256-6U86+FSSMC96gZRBRY+AvKCtmRLlpMg8aZ/zxjxSlX0="
else
abort "Invalid kernel version: ${kernelVersion}";

View File

@@ -9,7 +9,7 @@
{
name = "microsoft-surface-patches-linux-${version}";
patch = null;
extraStructuredConfig = with kernel; {
structuredExtraConfig = with kernel; {
STAGING_MEDIA = yes;
##

View File

@@ -9,7 +9,7 @@
{
name = "microsoft-surface-patches-linux-${version}";
patch = null;
extraStructuredConfig = with kernel; {
structuredExtraConfig = with kernel; {
STAGING_MEDIA = yes;
##
## Surface Aggregator Module

View File

@@ -24,8 +24,7 @@ let
let
inherit (builtins) removeAttrs;
args' =
{
args' = {
inherit
src
version

10
mnt/reform/default.nix Normal file
View File

@@ -0,0 +1,10 @@
{
config,
lib,
pkgs,
...
}:
{
boot.kernelPackages = pkgs.callPackage ./kernel.nix { };
boot.extraModulePackages = [ (config.boot.kernelPackages.callPackage ./lpc.nix { }) ];
}

48
mnt/reform/dtsPatch.nix Normal file
View File

@@ -0,0 +1,48 @@
{
stdenv,
reformDebianPackages,
kernelSource,
quilt,
}:
stdenv.mkDerivation {
name = "mnt-dts-patch";
nativeBuildInputs = [ quilt ];
buildCommand = ''
cp -r --reflink=auto ${reformDebianPackages}/linux/* .
mkdir -p linux/debian/patches/reform
cp -r --reflink=auto ${kernelSource}/* linux
chmod +w -R .
env --chdir=linux QUILT_PATCHES=debian/patches quilt new reform/dts.patch
env --chdir=linux QUILT_PATCHES=debian/patches quilt add arch/arm64/boot/dts/freescale/fsl-ls1028a-mnt-reform2.dts
cp fsl-ls1028a-mnt-reform2.dts linux/arch/arm64/boot/dts/freescale/fsl-ls1028a-mnt-reform2.dts
env --chdir=linux QUILT_PATCHES=debian/patches quilt add arch/arm64/boot/dts/freescale/imx8mq-mnt-reform2-hdmi.dts
cp imx8mq-mnt-reform2-hdmi.dts linux/arch/arm64/boot/dts/freescale/imx8mq-mnt-reform2-hdmi.dts
env --chdir=linux QUILT_PATCHES=debian/patches quilt add arch/arm64/boot/dts/freescale/Makefile
sed -i '/fsl-ls1028a-rdb.dtb/a dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-mnt-reform2.dtb' linux/arch/arm64/boot/dts/freescale/Makefile
sed -i '/imx8mq-mnt-reform2.dtb/a dtb-$(CONFIG_ARCH_MXC) += imx8mq-mnt-reform2-hdmi.dtb' linux/arch/arm64/boot/dts/freescale/Makefile
env --chdir=linux QUILT_PATCHES=debian/patches quilt add arch/arm64/boot/dts/freescale/imx8mp-mnt-pocket-reform.dts
cp imx8mp-mnt-pocket-reform.dts linux/arch/arm64/boot/dts/freescale/imx8mp-mnt-pocket-reform.dts
env --chdir=linux QUILT_PATCHES=debian/patches quilt add arch/arm64/boot/dts/freescale/imx8mp-mnt-reform2.dts
cp imx8mp-mnt-reform2.dts linux/arch/arm64/boot/dts/freescale/imx8mp-mnt-reform2.dts
sed -i '/imx8mq-mnt-reform2.dtb/a dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-pocket-reform.dtb' linux/arch/arm64/boot/dts/freescale/Makefile
sed -i '/imx8mq-mnt-reform2.dtb/a dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-reform2.dtb' linux/arch/arm64/boot/dts/freescale/Makefile
env --chdir=linux QUILT_PATCHES=debian/patches quilt add arch/arm64/boot/dts/amlogic/meson-g12b-bananapi-cm4-mnt-pocket-reform.dts
cp meson-g12b-bananapi-cm4-mnt-pocket-reform.dts linux/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi-cm4-mnt-pocket-reform.dts
env --chdir=linux QUILT_PATCHES=debian/patches quilt add arch/arm64/boot/dts/amlogic/Makefile
sed -i '/meson-g12b-bananapi-cm4-mnt-reform2.dtb/a dtb-$(CONFIG_ARCH_MESON) += meson-g12b-bananapi-cm4-mnt-pocket-reform.dtb' linux/arch/arm64/boot/dts/amlogic/Makefile
env --chdir=linux QUILT_PATCHES=debian/patches quilt add arch/arm64/boot/dts/rockchip/rk3588-mnt-reform2.dts
cp rk3588-mnt-reform2.dts linux/arch/arm64/boot/dts/rockchip/rk3588-mnt-reform2.dts
env --chdir=linux QUILT_PATCHES=debian/patches quilt add arch/arm64/boot/dts/rockchip/rk3588-mnt-reform2-dsi.dts
cp rk3588-mnt-reform2-dsi.dts linux/arch/arm64/boot/dts/rockchip/rk3588-mnt-reform2-dsi.dts
env --chdir=linux QUILT_PATCHES=debian/patches quilt add arch/arm64/boot/dts/rockchip/rk3588-mnt-pocket-reform.dts
cp rk3588-mnt-pocket-reform.dts linux/arch/arm64/boot/dts/rockchip/rk3588-mnt-pocket-reform.dts
env --chdir=linux QUILT_PATCHES=debian/patches quilt add arch/arm64/boot/dts/rockchip/rk3588-mnt-reform-next.dts
cp rk3588-mnt-reform-next.dts linux/arch/arm64/boot/dts/rockchip/rk3588-mnt-reform-next.dts
env --chdir=linux QUILT_PATCHES=debian/patches quilt add arch/arm64/boot/dts/rockchip/Makefile
sed -i '/rk3588-mnt-reform2.dtb/a dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform2-dsi.dtb' linux/arch/arm64/boot/dts/rockchip/Makefile
sed -i '/rk3588-mnt-reform2-dsi.dtb/a dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform-next.dtb' linux/arch/arm64/boot/dts/rockchip/Makefile
sed -i '/rk3588-mnt-reform-next.dtb/a dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-pocket-reform.dtb' linux/arch/arm64/boot/dts/rockchip/Makefile
env --chdir=linux QUILT_PATCHES=debian/patches quilt refresh
cp linux/debian/patches/reform/dts.patch $out
'';
}

148
mnt/reform/kernel.nix Normal file
View File

@@ -0,0 +1,148 @@
{
lib,
callPackage,
linuxPackagesFor,
kernelPatches,
fetchFromGitLab,
...
}:
let
modDirVersion = "6.16.5";
reformDebianPackages = fetchFromGitLab {
domain = "source.mnt.re";
owner = "reform";
repo = "reform-debian-packages";
rev = "830c94db42beef876dc58ea56711659ae7bd415d";
hash = "sha256-mdORgTOM7RJnEjY5G/iWMHf69wQkql11yRpQ/DrQKb4=";
};
linuxPkg =
{
lib,
fetchzip,
buildLinux,
callPackage,
...
}@args:
buildLinux (
args
// rec {
version = "${modDirVersion}-mnt-reform";
inherit modDirVersion;
src = fetchzip {
url = "mirror://kernel/linux/kernel/v${lib.versions.major modDirVersion}.x/linux-${modDirVersion}.tar.xz";
hash = "sha256-XiTuH40b3VJqzwygZzU0FcvMDj41Rq6IsMbm+3+QxDY=";
};
kernelPatches =
(map (patch: { inherit patch; }) (
lib.filesystem.listFilesRecursive "${reformDebianPackages}/linux/patches${lib.versions.majorMinor modDirVersion}"
))
++ [
{
patch = callPackage ./dtsPatch.nix {
inherit reformDebianPackages;
kernelSource = src;
};
}
];
structuredExtraConfig = with lib.kernel; {
# configuration options from https://source.mnt.re/reform/reform-debian-packages/-/blob/7f31ba3a6742d60d8d502c1d86e63ef5df3916bf/linux/config
DRM_LVDS_CODEC = module;
DRM_CDNS_MHDP8546 = module;
DRM_CDNS_HDMI_CEC = module;
DRM_IMX_CDNS_MHDP = module;
DRM_IMX_DCSS = module;
# PHY_FSL_IMX8MQ_HDPTX = module; # configuration option does not exist
DRM_PANEL_LVDS = module;
I2C_IMX_LPI2C = module;
I2C_MUX_REG = module;
INTERCONNECT_IMX = yes;
INTERCONNECT_IMX8MQ = yes;
MFD_WM8994 = module;
MUX_GPIO = module;
MUX_MMIO = module;
RTC_DRV_PCF8523 = module;
USB_EHCI_FSL = module;
# NO_HZ_IDLE = yes; # conflicts with NO_HZ_FULL
SND_SOC_FSL_MICFIL = module;
SND_IMX_SOC = module;
SND_SOC_FSL_ASOC_CARD = module;
SND_SOC_IMX_AUDMIX = module;
SND_SOC_IMX_HDMI = module;
INPUT_JOYSTICK = yes;
JOYSTICK_XPAD = module;
JOYSTICK_XPAD_FF = yes;
JOYSTICK_XPAD_LEDS = yes;
INTERCONNECT_IMX8MP = yes;
SND_SOC_FSL_ASRC = yes;
DRM_IMX_LCDIF = yes;
DRM_IMX8MP_DW_HDMI_BRIDGE = yes;
DRM_IMX8MP_HDMI_PVI = yes;
IMX8MM_THERMAL = yes;
IMX2_WDT = yes;
DRM_SAMSUNG_DSIM = yes;
PHY_FSL_SAMSUNG_HDMI_PHY = yes;
DRM = yes;
DRM_PANEL_MNT_POCKET_REFORM = module;
IMX8M_BLK_CTRL = yes;
IMX_GPCV2_PM_DOMAINS = yes;
DRM_DISPLAY_CONNECTOR = yes;
DRM_FSL_LDB = yes;
BACKLIGHT_CLASS_DEVICE = yes;
BACKLIGHT_PWM = yes;
BACKLIGHT_GPIO = yes;
BACKLIGHT_LED = yes;
CPU_FREQ_GOV_PERFORMANCE = yes;
CPU_FREQ_GOV_POWERSAVE = yes;
CPU_FREQ_GOV_USERSPACE = yes;
CPU_FREQ_GOV_ONDEMAND = yes;
CPU_FREQ_GOV_CONSERVATIVE = yes;
CPU_FREQ_GOV_SCHEDUTIL = yes;
ARM_IMX_CPUFREQ_DT = yes;
ARM_IMX_BUS_DEVFREQ = yes;
IMX_IRQSTEER = yes;
PCI_MESON = yes;
DWMAC_MESON = module;
MDIO_BUS_MUX_MESON_G12A = yes;
I2C_MESON = yes;
PWM_MESON = yes;
USB_DWC3_MESON_G12A = yes;
MMC_MESON_GX = yes;
MMC_MESON_MX_SDIO = yes;
MESON_DDR_PMU = yes;
RTW88_8822CS = module;
PWM_FSL_FTM = yes;
FSL_RCPM = yes;
ARCH_ROCKCHIP = yes;
# ARM_ROCKCHIP_CPUFREQ = module; # configuration option does not exist
DRM_PANTHOR = module;
NVMEM_ROCKCHIP_OTP = yes;
PHY_ROCKCHIP_SAMSUNG_HDPTX = module;
PHY_ROCKCHIP_USBDP = module;
REGULATOR = yes;
# ROCKCHIP_REGULATOR_COUPLER = yes; # configuration option does not exist
SPI_ROCKCHIP = yes;
SPI_ROCKCHIP_SFC = module;
ARM_SCMI_CPUFREQ = module;
VIDEO_ROCKCHIP_VDEC2 = module;
ROCKCHIP_DW_HDMI_QP = yes;
ROCKCHIP_DW_MIPI_DSI2 = yes;
PHY_ROCKCHIP_SAMSUNG_DCPHY = yes;
REGULATOR_FIXED_VOLTAGE = yes;
GPIO_ROCKCHIP = yes;
PL330_DMA = yes;
DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW = no; # patches for 6.16 break this driver
};
}
// (args.argsOverride or { })
);
in
lib.recurseIntoAttrs (linuxPackagesFor (callPackage linuxPkg { }))

36
mnt/reform/lpc.nix Normal file
View File

@@ -0,0 +1,36 @@
{
stdenv,
lib,
fetchFromGitLab,
kernel,
kernelModuleMakeFlags,
kmod,
}:
stdenv.mkDerivation rec {
name = "lpc";
src = fetchFromGitLab {
domain = "source.mnt.re";
owner = "reform";
repo = "reform-tools";
rev = "45f930403492aa2156522bfe30edb02e33494b69";
hash = "sha256-no33CsV69nu1TR0cqxQDd1bFXqhjqOW9IUDxds0fyxE=";
};
sourceRoot = "source/lpc";
hardeningDisable = [
"pic"
"format"
];
nativeBuildInputs = kernel.moduleBuildDependencies;
installPhase = ''
make -C "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" M="$(pwd)" INSTALL_MOD_PATH=$out modules_install $makeFlags
'';
makeFlags = kernelModuleMakeFlags ++ [
"KERNEL_DIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
"INSTALL_MOD_PATH=${placeholder "out"}"
];
}

View File

@@ -0,0 +1,48 @@
# MNT Reform Laptop with RK3588 CPU module
## Creating an installer SD-Image
Create and configure the `flake.nix` file:
``` nix
{
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
inputs.nixos-hardware.url = "github:nixos/nixos-hardware";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, nixos-hardware, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
rec {
packages.default = packages.installer;
packages.installer = (import "${nixpkgs}/nixos" {
configuration =
{ config, ... }: {
imports = [
"${nixos-hardware}/mnt/reform/rk3588/installer.nix"
];
# If you want to use ssh set a password
# users.users.nixos.password = "super secure password";
# OR add your public ssh key
# users.users.nixos.openssh.authorizedKeys.keys = [ "ssh-rsa ..." ];
# Additional configuration goes here
# Only used when cross compiling
nixpkgs.crossSystem = {
config = "aarch64-unknown-linux-gnu";
system = "aarch64-linux";
};
system.stateVersion = "23.05";
};
inherit system;
}).config.system.build.image;;
});
}
```
Build the installer image.
``` sh
nix build .#
```

View File

@@ -0,0 +1,35 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [ ../. ];
boot = {
# kernelParams = [ "console=ttyS2,1500000n8" ];
kernelParams = [
"no_console_suspend"
"console=tty1"
];
# kernel modules needed for the virtual console
initrd.availableKernelModules = [
"panel-edp"
"phy-rockchip-samsung-hdptx"
"rockchipdrm"
"ti-sn65dsi86"
];
};
boot.loader = {
grub.enable = false;
generic-extlinux-compatible.enable = true;
};
hardware.alsa.enablePersistence = true;
system.activationScripts.asound = ''
if [ ! -e "/var/lib/alsa/asound.state" ]; then
mkdir -p /var/lib/alsa
cp ${./initial-asound.state} /var/lib/alsa/asound.state
fi
'';
}

View File

@@ -0,0 +1,25 @@
{
runCommand,
uboot,
fetchFromGitHub,
}:
# script from https://source.mnt.re/reform/reform-rk3588-uboot/-/blob/b530d65f4a878c0329a594fa248ba8da59d2e05f/build.sh
runCommand "mnt-reform-firmware-rk3855${uboot.variant}" { } ''
mkdir $out
cp -r ${uboot} u-boot
cp -r ${uboot.rkbin} rkbin
chmod -R +rw u-boot
chmod -R +rw rkbin
cd u-boot
mkdir spl
mv u-boot-spl.bin spl
../rkbin/tools/boot_merger rock5b-rk3588.ini
cd ..
# rkbin stuff
cd rkbin
./tools/boot_merger RKBOOT/RK3588MINIALL.ini
# concatenate
cd ..
cp u-boot/idbloader.img $out/mnt-reform2-rk3588${uboot.variant}-flash.bin
dd if=u-boot/u-boot.itb of=$out/mnt-reform2-rk3588${uboot.variant}-flash.bin seek=16320
''

View File

@@ -0,0 +1,702 @@
state.rk3588wm8960 {
control.1 {
iface MIXER
name 'Capture Volume'
value.0 39
value.1 39
comment {
access 'read write'
type INTEGER
count 2
range '0 - 63'
dbmin -1725
dbmax 3000
dbvalue.0 1200
dbvalue.1 1200
}
}
control.2 {
iface MIXER
name 'Capture Volume ZC Switch'
value.0 false
value.1 false
comment {
access 'read write'
type BOOLEAN
count 2
}
}
control.3 {
iface MIXER
name 'Capture Switch'
value.0 true
value.1 true
comment {
access 'read write'
type BOOLEAN
count 2
}
}
control.4 {
iface MIXER
name 'Left Input Boost Mixer LINPUT3 Volume'
value 0
comment {
access 'read write'
type INTEGER
count 1
range '0 - 7'
dbmin -9999999
dbmax 600
dbvalue.0 -9999999
}
}
control.5 {
iface MIXER
name 'Left Input Boost Mixer LINPUT2 Volume'
value 0
comment {
access 'read write'
type INTEGER
count 1
range '0 - 7'
dbmin -9999999
dbmax 600
dbvalue.0 -9999999
}
}
control.6 {
iface MIXER
name 'Right Input Boost Mixer RINPUT3 Volume'
value 0
comment {
access 'read write'
type INTEGER
count 1
range '0 - 7'
dbmin -9999999
dbmax 600
dbvalue.0 -9999999
}
}
control.7 {
iface MIXER
name 'Right Input Boost Mixer RINPUT2 Volume'
value 0
comment {
access 'read write'
type INTEGER
count 1
range '0 - 7'
dbmin -9999999
dbmax 600
dbvalue.0 -9999999
}
}
control.8 {
iface MIXER
name 'Right Input Boost Mixer RINPUT1 Volume'
value 0
comment {
access 'read write'
type INTEGER
count 1
range '0 - 3'
dbmin 0
dbmax 2900
dbvalue.0 0
}
}
control.9 {
iface MIXER
name 'Left Input Boost Mixer LINPUT1 Volume'
value 0
comment {
access 'read write'
type INTEGER
count 1
range '0 - 3'
dbmin 0
dbmax 2900
dbvalue.0 0
}
}
control.10 {
iface MIXER
name 'Playback Volume'
value.0 215
value.1 215
comment {
access 'read write'
type INTEGER
count 2
range '0 - 255'
dbmin -9999999
dbmax 0
dbvalue.0 -2000
dbvalue.1 -2000
}
}
control.11 {
iface MIXER
name 'Headphone Playback Volume'
value.0 0
value.1 0
comment {
access 'read write'
type INTEGER
count 2
range '0 - 127'
dbmin -9999999
dbmax 600
dbvalue.0 -9999999
dbvalue.1 -9999999
}
}
control.12 {
iface MIXER
name 'Headphone Playback ZC Switch'
value.0 false
value.1 false
comment {
access 'read write'
type BOOLEAN
count 2
}
}
control.13 {
iface MIXER
name 'Speaker Playback Volume'
value.0 109
value.1 109
comment {
access 'read write'
type INTEGER
count 2
range '0 - 127'
dbmin -9999999
dbmax 600
dbvalue.0 -1200
dbvalue.1 -1200
}
}
control.14 {
iface MIXER
name 'Speaker Playback ZC Switch'
value.0 false
value.1 false
comment {
access 'read write'
type BOOLEAN
count 2
}
}
control.15 {
iface MIXER
name 'Speaker DC Volume'
value 0
comment {
access 'read write'
type INTEGER
count 1
range '0 - 5'
}
}
control.16 {
iface MIXER
name 'Speaker AC Volume'
value 0
comment {
access 'read write'
type INTEGER
count 1
range '0 - 5'
}
}
control.17 {
iface MIXER
name 'PCM Playback -6dB Switch'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.18 {
iface MIXER
name 'ADC Polarity'
value 'No Inversion'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 'No Inversion'
item.1 'Left Inverted'
item.2 'Right Inverted'
item.3 'Stereo Inversion'
}
}
control.19 {
iface MIXER
name 'ADC High Pass Filter Switch'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.20 {
iface MIXER
name 'DAC Polarity'
value 'No Inversion'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 'No Inversion'
item.1 'Left Inverted'
item.2 'Right Inverted'
item.3 'Stereo Inversion'
}
}
control.21 {
iface MIXER
name 'DAC Deemphasis Switch'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.22 {
iface MIXER
name '3D Filter Upper Cut-Off'
value High
comment {
access 'read write'
type ENUMERATED
count 1
item.0 High
item.1 Low
}
}
control.23 {
iface MIXER
name '3D Filter Lower Cut-Off'
value Low
comment {
access 'read write'
type ENUMERATED
count 1
item.0 Low
item.1 High
}
}
control.24 {
iface MIXER
name '3D Volume'
value 0
comment {
access 'read write'
type INTEGER
count 1
range '0 - 15'
}
}
control.25 {
iface MIXER
name '3D Switch'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.26 {
iface MIXER
name 'ALC Function'
value Off
comment {
access 'read write'
type ENUMERATED
count 1
item.0 Off
item.1 Right
item.2 Left
item.3 Stereo
}
}
control.27 {
iface MIXER
name 'ALC Max Gain'
value 7
comment {
access 'read write'
type INTEGER
count 1
range '0 - 7'
}
}
control.28 {
iface MIXER
name 'ALC Target'
value 4
comment {
access 'read write'
type INTEGER
count 1
range '0 - 15'
}
}
control.29 {
iface MIXER
name 'ALC Min Gain'
value 0
comment {
access 'read write'
type INTEGER
count 1
range '0 - 7'
}
}
control.30 {
iface MIXER
name 'ALC Hold Time'
value 0
comment {
access 'read write'
type INTEGER
count 1
range '0 - 15'
}
}
control.31 {
iface MIXER
name 'ALC Mode'
value ALC
comment {
access 'read write'
type ENUMERATED
count 1
item.0 ALC
item.1 Limiter
}
}
control.32 {
iface MIXER
name 'ALC Decay'
value 3
comment {
access 'read write'
type INTEGER
count 1
range '0 - 15'
}
}
control.33 {
iface MIXER
name 'ALC Attack'
value 2
comment {
access 'read write'
type INTEGER
count 1
range '0 - 15'
}
}
control.34 {
iface MIXER
name 'Noise Gate Threshold'
value 0
comment {
access 'read write'
type INTEGER
count 1
range '0 - 31'
}
}
control.35 {
iface MIXER
name 'Noise Gate Switch'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.36 {
iface MIXER
name 'ADC PCM Capture Volume'
value.0 195
value.1 195
comment {
access 'read write'
type INTEGER
count 2
range '0 - 255'
dbmin -9999999
dbmax 3000
dbvalue.0 0
dbvalue.1 0
}
}
control.37 {
iface MIXER
name 'Left Output Mixer Boost Bypass Volume'
value 2
comment {
access 'read write'
type INTEGER
count 1
range '0 - 7'
dbmin -2100
dbmax 0
dbvalue.0 -1500
}
}
control.38 {
iface MIXER
name 'Left Output Mixer LINPUT3 Volume'
value 2
comment {
access 'read write'
type INTEGER
count 1
range '0 - 7'
dbmin -2100
dbmax 0
dbvalue.0 -1500
}
}
control.39 {
iface MIXER
name 'Right Output Mixer Boost Bypass Volume'
value 2
comment {
access 'read write'
type INTEGER
count 1
range '0 - 7'
dbmin -2100
dbmax 0
dbvalue.0 -1500
}
}
control.40 {
iface MIXER
name 'Right Output Mixer RINPUT3 Volume'
value 2
comment {
access 'read write'
type INTEGER
count 1
range '0 - 7'
dbmin -2100
dbmax 0
dbvalue.0 -1500
}
}
control.41 {
iface MIXER
name 'ADC Data Output Select'
value 'Left Data = Left ADC; Right Data = Right ADC'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 'Left Data = Left ADC; Right Data = Right ADC'
item.1 'Left Data = Left ADC; Right Data = Left ADC'
item.2 'Left Data = Right ADC; Right Data = Right ADC'
item.3 'Left Data = Right ADC; Right Data = Left ADC'
}
}
control.42 {
iface MIXER
name 'DAC Mono Mix'
value Stereo
comment {
access 'read write'
type ENUMERATED
count 1
item.0 Stereo
item.1 Mono
}
}
control.43 {
iface MIXER
name 'DAC Filter Characteristics'
value Normal
comment {
access 'read write'
type ENUMERATED
count 1
item.0 Normal
item.1 Sloping
}
}
control.44 {
iface MIXER
name 'Left Boost Mixer LINPUT2 Switch'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.45 {
iface MIXER
name 'Left Boost Mixer LINPUT3 Switch'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.46 {
iface MIXER
name 'Left Boost Mixer LINPUT1 Switch'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.47 {
iface MIXER
name 'Right Boost Mixer RINPUT2 Switch'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.48 {
iface MIXER
name 'Right Boost Mixer RINPUT3 Switch'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.49 {
iface MIXER
name 'Right Boost Mixer RINPUT1 Switch'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.50 {
iface MIXER
name 'Left Input Mixer Boost Switch'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.51 {
iface MIXER
name 'Right Input Mixer Boost Switch'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.52 {
iface MIXER
name 'Left Output Mixer PCM Playback Switch'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.53 {
iface MIXER
name 'Left Output Mixer LINPUT3 Switch'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.54 {
iface MIXER
name 'Left Output Mixer Boost Bypass Switch'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.55 {
iface MIXER
name 'Right Output Mixer PCM Playback Switch'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.56 {
iface MIXER
name 'Right Output Mixer RINPUT3 Switch'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.57 {
iface MIXER
name 'Right Output Mixer Boost Bypass Switch'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.58 {
iface MIXER
name 'Mono Output Mixer Left Switch'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.59 {
iface MIXER
name 'Mono Output Mixer Right Switch'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
}

View File

@@ -0,0 +1,239 @@
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports = [
"${modulesPath}/image/file-options.nix"
"${modulesPath}/profiles/installation-device.nix"
./.
];
options.installerImage = {
compressImage = lib.mkOption {
default = false;
type = lib.types.bool;
description = ''
Whether the installer image should be compressed using
{command}`zstd`.
'';
};
squashfsCompression = lib.mkOption {
default = "zstd -Xcompression-level 19";
type = lib.types.nullOr lib.types.str;
description = ''
Compression settings to use for the squashfs nix store.
`null` disables compression.
'';
example = "zstd -Xcompression-level 6";
};
storeContents = lib.mkOption {
example = lib.literalExpression "[ pkgs.stdenv ]";
description = ''
This option lists additional derivations to be included in the
Nix store in the generated installer image.
'';
};
};
config =
let
squashfs = pkgs.callPackage "${modulesPath}/../lib/make-squashfs.nix" {
storeContents = config.installerImage.storeContents;
comp = config.installerImage.squashfsCompression;
};
uboot = pkgs.callPackage ./uboot.nix { };
firmware = pkgs.callPackage ./firmware.nix { inherit uboot; };
content = pkgs.callPackage (
{
stdenv,
e2fsprogs,
libfaketime,
fakeroot,
}:
stdenv.mkDerivation {
name = "ext4-fs.img";
nativeBuildInputs = [
e2fsprogs.bin
libfaketime
fakeroot
];
buildCommand = ''
img=$out
mkdir -p ./files
${config.boot.loader.generic-extlinux-compatible.populateCmd} -c ${config.system.build.toplevel} -d ./rootImage/boot
(
GLOBIGNORE=".:.."
shopt -u dotglob
for f in ./files/*; do
cp -a --reflink=auto -t ./rootImage/ "$f"
done
)
cp -a --reflink=auto ${squashfs} ./rootImage/nix-store.squashfs
# Make a crude approximation of the size of the target image.
# If the script starts failing, increase the fudge factors here.
numInodes=$(find ./rootImage | wc -l)
numDataBlocks=$(du -s -c -B 4096 --apparent-size ./rootImage | tail -1 | awk '{ print int($1 * 1.20) }')
bytes=$((2 * 4096 * $numInodes + 4096 * $numDataBlocks))
echo "Creating an EXT4 image of $bytes bytes (numInodes=$numInodes, numDataBlocks=$numDataBlocks)"
mebibyte=$(( 1024 * 1024 ))
# Round up to the nearest mebibyte.
# This ensures whole 512 bytes sector sizes in the disk image
# and helps towards aligning partitions optimally.
if (( bytes % mebibyte )); then
bytes=$(( ( bytes / mebibyte + 1) * mebibyte ))
fi
truncate -s $bytes $img
faketime -f "1970-01-01 00:00:01" fakeroot mkfs.ext4 -L NIXOS_ROOT -U 44444444-4444-4444-8888-888888888888 -d ./rootImage $img
export EXT2FS_NO_MTAB_OK=yes
# I have ended up with corrupted images sometimes, I suspect that happens when the build machine's disk gets full during the build.
if ! fsck.ext4 -n -f $img; then
echo "--- Fsck failed for EXT4 image of $bytes bytes (numInodes=$numInodes, numDataBlocks=$numDataBlocks) ---"
cat errorlog
return 1
fi
# We may want to shrink the file system and resize the image to
# get rid of the unnecessary slack here--but see
# https://github.com/NixOS/nixpkgs/issues/125121 for caveats.
# shrink to fit
resize2fs -M $img
# Add 16 MebiByte to the current_size
new_size=$(dumpe2fs -h $img | awk -F: \
'/Block count/{count=$2} /Block size/{size=$2} END{print (count*size+16*2**20)/size}')
resize2fs $img $new_size
'';
}
) { };
in
{
fileSystems = {
"/" = lib.mkImageMediaOverride {
fsType = "tmpfs";
options = [ "mode=0755" ];
};
"/iso" = lib.mkImageMediaOverride {
device = "/dev/disk/by-label/NIXOS_ROOT";
neededForBoot = true;
noCheck = true;
options = [ "ro" ];
};
# In stage 1, mount a tmpfs on top of /nix/store (the squashfs
# image) to make this a live CD.
"/nix/.ro-store" = lib.mkImageMediaOverride {
fsType = "squashfs";
device = "/iso/nix-store.squashfs";
options = [
"loop"
]
++ lib.optional (config.boot.kernelPackages.kernel.kernelAtLeast "6.2") "threads=multi";
neededForBoot = true;
};
"/nix/.rw-store" = lib.mkImageMediaOverride {
fsType = "tmpfs";
options = [ "mode=0755" ];
neededForBoot = true;
};
"/nix/store" = lib.mkImageMediaOverride {
fsType = "overlay";
device = "overlay";
options = [
"lowerdir=/nix/.ro-store"
"upperdir=/nix/.rw-store/store"
"workdir=/nix/.rw-store/work"
];
depends = [
"/nix/.ro-store"
"/nix/.rw-store/store"
"/nix/.rw-store/work"
];
};
};
boot = {
initrd.availableKernelModules = [
"squashfs"
"uas"
"overlay"
];
initrd.kernelModules = [
"loop"
"overlay"
];
loader.timeout = 0;
};
image.extension = if config.installerImage.compressImage then "img.zst" else "img";
image.filePath = "installer-image/${config.image.fileName}";
installerImage.storeContents = [ config.system.build.toplevel ];
system.build.image = pkgs.callPackage (
{ stdenv, util-linux }:
stdenv.mkDerivation {
name = config.image.fileName;
nativeBuildInputs = [ util-linux ];
inherit (config.installerImage) compressImage;
buildCommand = ''
mkdir -p $out/nix-support $out/installer-image
img=$out/installer-image/${config.image.baseName}.img
echo "${stdenv.buildPlatform.system}" > $out/nix-support/system
if test -n "$compressImage"; then
echo "file installer-image $img.zst" >> $out/nix-support/hydra-build-products
else
echo "file installer-image $img" >> $out/nix-support/hydra-build-products
fi
sectors=$((($(stat -c '%s' ${content})+511)/512))
# create disk image
truncate -s $((($sectors + 32768 + 2048)*512)) $img
sfdisk $img <<EOF
label: gpt
unit: sectors
sector-size: 512
start=32768, size=$sectors, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, attrs="LegacyBIOSBootable"
EOF
eval $(partx $img -o START,SECTORS --nr 1 --pairs)
dd conv=notrunc if=${content} of=$img seek=$START count=$SECTORS
dd conv=notrunc if=${firmware}/mnt-reform2-rk3588-dsi-flash.bin of=$img seek=64
if test -n "$compressImage"; then
zstd -T$NIX_BUILD_CORES --rm $img
fi
'';
}
) { };
boot.postBootCommands = ''
# After booting, register the contents of the Nix store on the
# CD in the Nix database in the tmpfs.
${config.nix.package.out}/bin/nix-store --load-db < /nix/store/nix-path-registration
# nixos-rebuild also requires a "system" profile and an
# /etc/NIXOS tag.
touch /etc/NIXOS
${config.nix.package.out}/bin/nix-env -p /nix/var/nix/profiles/system --set /run/current-system
'';
boot.initrd.supportedFilesystems = [ "ext4" ];
};
}

View File

@@ -0,0 +1,54 @@
{
buildUBoot,
python3,
armTrustedFirmwareRK3588,
fetchFromGitLab,
fetchFromGitHub,
}:
let
mntPatches = fetchFromGitLab {
domain = "source.mnt.re";
owner = "reform";
repo = "reform-rk3588-uboot";
rev = "55bca0174e7bb449e96028d64ad8348f5af35977";
hash = "sha256-A3u1afGK65cGOwENQtu8Hh+fLsSDNxc3rEebkd3QOic=";
};
rkbin = fetchFromGitHub {
owner = "rockchip-linux";
repo = "rkbin";
rev = "f43a462e7a1429a9d407ae52b4745033034a6cf9";
hash = "sha256-geESfZP8ynpUz/i/thpaimYo3kzqkBX95gQhMBzNbmk=";
};
in
buildUBoot rec {
src = fetchFromGitLab {
domain = "gitlab.collabora.com";
owner = "hardware-enablement";
repo = "rockchip-3588/u-boot";
rev = "424c714eb24731e16509231a817c76d4a6ae0ecc";
hash = "sha256-26XLcPundNjRcXrSq2V5PaW6M269rsouOV56ymsptzc=";
};
version = "424c714eb24731e16509231a817c76d4a6ae0ecc";
patches = [
"${mntPatches}/0001-ini-ddrbin-bump.patch"
"${mntPatches}/0002-add-target-init-mnt-reform-series.patch"
];
prePatch = ''
cp ${mntPatches}/*.dts arch/arm/dts/
cp ${mntPatches}/*_defconfig configs/
''; # postPatch is already occupied
filesToInstall = [
"idbloader.img"
"u-boot.itb"
"rock5b-rk3588.ini"
"spl/u-boot-spl.bin"
];
variant = "-dsi";
defconfig = "mnt-reform2-rk3588${variant}_defconfig";
extraMakeFlags = [
"BL31=${armTrustedFirmwareRK3588}/bl31.elf"
"ROCKCHIP_TPL=${rkbin}/bin/rk35/rk3588_ddr_lp4_2112MHz_lp5_2400MHz_v1.18.bin"
];
passthru.rkbin = rkbin;
}

Some files were not shown because too many files have changed in this diff Show More