mirror of
https://github.com/NixOS/nixos-hardware.git
synced 2026-12-02 22:13:29 +01:00
Compare commits
68
Commits
bubuntux-master
...
tlp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e60c66bd0b | ||
|
|
e4c6ee69e7 | ||
|
|
ae91411396 | ||
|
|
d48e8f0e16 | ||
|
|
eea20ba3b0 | ||
|
|
2e85ae1b70 | ||
|
|
8b72f74d80 | ||
|
|
655a6da8a8 | ||
|
|
bffe23e699 | ||
|
|
5ad68c5dff | ||
|
|
fad92f5f57 | ||
|
|
f2e49f279c | ||
|
|
e598a4ca2f | ||
|
|
2567706185 | ||
|
|
7467f155fc | ||
|
|
ddb27b7bba | ||
|
|
13cc234e37 | ||
|
|
a2bc09823a | ||
|
|
86d9291cc3 | ||
|
|
8650454db6 | ||
|
|
11ea8b8477 | ||
|
|
a3576f0f3c | ||
|
|
fe21eda733 | ||
|
|
43ffe9ac82 | ||
|
|
3beac2438b | ||
|
|
b09586b101 | ||
|
|
e07b1618c3 | ||
|
|
e214e292a6 | ||
|
|
779c16f604 | ||
|
|
6ec1e82182 | ||
|
|
4bafcc2454 | ||
|
|
46ab381a8c | ||
|
|
ec7bf039ca | ||
|
|
e11482075d | ||
|
|
2379bc4099 | ||
|
|
688ee555de | ||
|
|
8b405e9c6d | ||
|
|
34b7229b95 | ||
|
|
46f9982c9b | ||
|
|
9c0ee5dfa1 | ||
|
|
7667e19678 | ||
|
|
b27995044c | ||
|
|
d6645c340e | ||
|
|
c4fe135227 | ||
|
|
9ed85f8afe | ||
|
|
c816590dca | ||
|
|
eb9e8e10ac | ||
|
|
156fbb62a9 | ||
|
|
c52ea60901 | ||
|
|
d232c6f9cc | ||
|
|
a8bbda8911 | ||
|
|
d0955d227d | ||
|
|
3441b5242a | ||
|
|
0257a0aa58 | ||
|
|
e087756cf4 | ||
|
|
a74f5ce8c6 | ||
|
|
dd4227bb1b | ||
|
|
30bf4efeda | ||
|
|
081542ae22 | ||
|
|
ba70d20716 | ||
|
|
28c41d0a5d | ||
|
|
27581273c2 | ||
|
|
40dffd02e3 | ||
|
|
0c55f0f776 | ||
|
|
8972e6538b | ||
|
|
c92f8fc536 | ||
|
|
37d0301b3c | ||
|
|
66e88bdcaa |
No files matched your search
@@ -11,11 +11,11 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
- uses: cachix/install-nix-action@v31
|
- uses: cachix/install-nix-action@v31
|
||||||
- run: cd tests && nix fmt .. -- --fail-on-change
|
- run: nix build .#checks.x86_64-linux.formatting
|
||||||
tests:
|
tests:
|
||||||
needs: nixfmt
|
needs: nixfmt
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
- uses: cachix/install-nix-action@v31
|
- uses: cachix/install-nix-action@v31
|
||||||
- run: nix run ./tests#run .
|
- run: nix run .#run-tests
|
||||||
+1
-1
@@ -11,4 +11,4 @@ purism/librem/13v3 @yegortimoshenko
|
|||||||
system76/darp6 @khumba
|
system76/darp6 @khumba
|
||||||
framework @emiller88
|
framework @emiller88
|
||||||
tuxedo/pulse/15/gen2 @trueNAHO
|
tuxedo/pulse/15/gen2 @trueNAHO
|
||||||
tuxedo/pulse/14/gen3 @gabyx @britter @trueNAHO
|
tuxedo/pulse/14/gen3 @gabyx @britter
|
||||||
+4
-3
@@ -14,8 +14,9 @@ For example:
|
|||||||
|
|
||||||
```nix
|
```nix
|
||||||
{ lib }: {
|
{ lib }: {
|
||||||
# Using mkDefault, because the user might want to disable tlp
|
# Using mkDefault, because the user might want to disable power-profiles-daemon
|
||||||
services.tlp.enable = lib.mkDefault true;
|
services.power-profiles-daemon.enable = lib.mkDefault true;
|
||||||
|
|
||||||
# No need to use mkDefault, because the setting will merge with the user's setting
|
# No need to use mkDefault, because the setting will merge with the user's setting
|
||||||
boot.kernelModules = [ "tmp_smapi" ];
|
boot.kernelModules = [ "tmp_smapi" ];
|
||||||
}
|
}
|
||||||
@@ -42,7 +43,7 @@ Link the profile in the table in README.md and in flake.nix.
|
|||||||
|
|
||||||
## 3. Testing
|
## 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
|
Because profiles can only be tested with the appropriate hardware, quality
|
||||||
assurance is up to *you*.
|
assurance is up to *you*.
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ All contributors and users are welcome to join!
|
|||||||
See code for all available configurations.
|
See code for all available configurations.
|
||||||
|
|
||||||
| Model | Path | Flake Module |
|
| Model | Path | Flake Module |
|
||||||
| --------------------------------------------------------------------------------- | ------------------------------------------------------- | ---------------------------------- |
|
| --------------------------------------------------------------------------------- | ------------------------------------------------------- | -------------------------------------- |
|
||||||
| [Acer Aspire 4810T](acer/aspire/4810t) | `<nixos-hardware/acer/aspire/4810t>` | `acer-aspire-4810t` |
|
| [Acer Aspire 4810T](acer/aspire/4810t) | `<nixos-hardware/acer/aspire/4810t>` | `acer-aspire-4810t` |
|
||||||
| [Airis N990](airis/n990) | `<nixos-hardware/airis/n990>` | `airis-n990` |
|
| [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 14.2](apple/imac/14-2) | `<nixos-hardware/apple/imac/14-2>` | `apple-imac-14-2` |
|
||||||
@@ -109,6 +109,7 @@ See code for all available configurations.
|
|||||||
| [Asus ROG Ally RC71L (2023)](asus/ally/rc71l) | `<nixos-hardware/asus/ally/rc71l>` | `asus-ally-rc71l` |
|
| [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/amdgpu) | `<nixos-hardware/asus/flow/gv302x/amdgpu>` | `asus-flow-gv302x-amdgpu` |
|
||||||
| [Asus ROG Flow X13 GV302X\* (2023)](asus/flow/gv302x/nvidia) | `<nixos-hardware/asus/flow/gv302x/nvidia>` | `asus-flow-gv302x-nvidia` |
|
| [Asus ROG Flow 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 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 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 G533Q](asus/rog-strix/g533q) | `<nixos-hardware/asus/rog-strix/g533q>` | `asus-rog-strix-g533zw` |
|
||||||
@@ -132,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 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 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 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` |
|
| [BeagleBoard PocketBeagle](beagleboard/pocketbeagle) | `<nixos-hardware/beagleboard/pocketbeagle>` | `beagleboard-pocketbeagle` |
|
||||||
| [Chuwi MiniBook X](chuwi/minibook-x) | `<nixos-hardware/chuwi/minibook-x>` | `chuwi-minibook-x` |
|
| [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` |
|
| [Deciso DEC series](deciso/dec) | `<nixos-hardware/deciso/dec>` | `deciso-dec` |
|
||||||
@@ -197,7 +199,7 @@ 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 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` |
|
| [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 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 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 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 Ryzen 7040 Series](framework/13-inch/7040-amd) | `<nixos-hardware/framework/13-inch/7040-amd>` | `framework-13-7040-amd` |
|
||||||
@@ -227,12 +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 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 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 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` |
|
| [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` |
|
| [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` |
|
| [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 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` |
|
| [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 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 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` |
|
| [Lenovo IdeaPad Gaming 3 15arh05](lenovo/ideapad/15arh05) | `<nixos-hardware/lenovo/ideapad/15arh05>` | `lenovo-ideapad-15arh05` |
|
||||||
@@ -259,6 +263,7 @@ 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 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 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 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 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 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-y530-15ich` |
|
| [Lenovo Legion Y530 15ICH](lenovo/legion/15ich) | `<nixos-hardware/lenovo/legion/15ich>` | `lenovo-legion-y530-15ich` |
|
||||||
@@ -281,6 +286,7 @@ 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 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 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 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 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 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 1](lenovo/thinkpad/p16s/amd/gen1) | `<nixos-hardware/lenovo/thinkpad/p16s/amd/gen1>` | `lenovo-thinkpad-p16s-amd-gen1` |
|
||||||
@@ -367,9 +373,11 @@ See code for all available configurations.
|
|||||||
| [Linglong Nova Studio](linglong/nova-studio) | `<nixos-hardware/linglong/nova-studio>` | `linglong-nova-studio` |
|
| [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 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 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 GS60 2QE](msi/gs60) | `<nixos-hardware/msi/gs60>` | `msi-gs60` |
|
||||||
| [MSI GL62/CX62](msi/gl62) | `<nixos-hardware/msi/gl62>` | `msi-gl62` |
|
| [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` |
|
| [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` |
|
| [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-go` |
|
| [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 Pro (Intel)](microsoft/surface/surface-pro-intel) | `<nixos-hardware/microsoft/surface/surface-pro-intel>` | `microsoft-surface-pro-intel` |
|
||||||
@@ -377,6 +385,7 @@ See code for all available configurations.
|
|||||||
| [Microsoft Surface Range (Common Modules)](microsoft/surface/common) | `<nixos-hardware/microsoft/surface/common>` | `microsoft-surface-common` |
|
| [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 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` |
|
| [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` |
|
| [Morefine M600](morefine/m600) | `<nixos-hardware/morefine/m600>` | `morefine-m600` |
|
||||||
| [Minisforum V3](minisforum/v3) | `<nixos-hardware/minisforum/v3>` | `minisforum-v3` |
|
| [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` |
|
| [MNT Reform with RK3588 module](mnt/reform/rk3588) | `<nixos-hardware/mnt/reform/rk3588` | `mnt-reform-rk3588` |
|
||||||
@@ -386,6 +395,7 @@ See code for all available configurations.
|
|||||||
| [Hardkernel Odroid HC4](hardkernel/odroid-hc4/default.nix) | `<nixos-hardware/hardkernel/odroid-hc4>` | `hardkernel-odroid-hc4` |
|
| [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 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` |
|
| [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 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-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` |
|
| [Omen 15-en0010ca](omen/15-en0010ca) | `<nixos-hardware/omen/15-en0010ca>` | `omen-15-en0010ca` |
|
||||||
@@ -394,6 +404,7 @@ See code for all available configurations.
|
|||||||
| [Omen 15-en1007sa](omen/15-en1007sa) | `<nixos-hardware/omen/15-en1007sa>` | `omen-15-en1007sa` |
|
| [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` |
|
| [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` |
|
| [One-Netbook OneNetbook 4](onenetbook/4) | `<nixos-hardware/onenetbook/4>` | `onenetbook-4` |
|
||||||
|
| [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` |
|
| [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` |
|
| [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 Pinebook Pro](pine64/pinebook-pro/) | `<nixos-hardware/pine64/pinebook-pro>` | `pine64-pinebook-pro` |
|
||||||
|
|||||||
@@ -29,7 +29,6 @@
|
|||||||
"bcma"
|
"bcma"
|
||||||
];
|
];
|
||||||
kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.0") pkgs.linuxPackages_latest;
|
kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.0") pkgs.linuxPackages_latest;
|
||||||
extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
hardware = {
|
hardware = {
|
||||||
|
|||||||
@@ -3,8 +3,6 @@
|
|||||||
{
|
{
|
||||||
imports = [ ../. ];
|
imports = [ ../. ];
|
||||||
|
|
||||||
boot.kernelModules = [ "wl" ];
|
|
||||||
boot.extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ];
|
|
||||||
boot.blacklistedKernelModules = [ "bcma" ];
|
boot.blacklistedKernelModules = [ "bcma" ];
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
|
|||||||
@@ -6,9 +6,5 @@
|
|||||||
../../../common/cpu/intel/haswell
|
../../../common/cpu/intel/haswell
|
||||||
];
|
];
|
||||||
|
|
||||||
# broadcom-wl
|
|
||||||
hardware.enableRedistributableFirmware = lib.mkDefault true;
|
hardware.enableRedistributableFirmware = lib.mkDefault true;
|
||||||
# nixos-generate-config doesn't detect this automatically.
|
|
||||||
boot.extraModulePackages = with config.boot.kernelPackages; [ broadcom_sta ];
|
|
||||||
boot.kernelModules = [ "wl" ];
|
|
||||||
}
|
}
|
||||||
@@ -31,10 +31,14 @@ in
|
|||||||
wantedBy = [
|
wantedBy = [
|
||||||
"local-fs.target"
|
"local-fs.target"
|
||||||
"suspend.target"
|
"suspend.target"
|
||||||
|
"suspend-then-hibernate.target"
|
||||||
|
"hibernate.target"
|
||||||
];
|
];
|
||||||
after = [
|
after = [
|
||||||
"local-fs.target"
|
"local-fs.target"
|
||||||
"suspend.target"
|
"suspend.target"
|
||||||
|
"suspend-then-hibernate.target"
|
||||||
|
"hibernate.target"
|
||||||
];
|
];
|
||||||
description = "Set the battery charge threshold to ${toString cfg.chargeUpto}%";
|
description = "Set the battery charge threshold to ${toString cfg.chargeUpto}%";
|
||||||
startLimitBurst = 5;
|
startLimitBurst = 5;
|
||||||
|
|||||||
@@ -25,10 +25,6 @@
|
|||||||
lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8")
|
lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8")
|
||||||
[ "rtc_cmos.use_acpi_alarm=1" ];
|
[ "rtc_cmos.use_acpi_alarm=1" ];
|
||||||
|
|
||||||
# AMD has better battery life with PPD over TLP:
|
|
||||||
# https://community.frame.work/t/responded-amd-7040-sleep-states/38101/13
|
|
||||||
services.power-profiles-daemon.enable = lib.mkDefault true;
|
|
||||||
|
|
||||||
# Adds the missing asus functionality to Linux.
|
# Adds the missing asus functionality to Linux.
|
||||||
# https://asus-linux.org/manual/asusctl-manual/
|
# https://asus-linux.org/manual/asusctl-manual/
|
||||||
services = {
|
services = {
|
||||||
|
|||||||
@@ -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";
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,13 +1,6 @@
|
|||||||
{ config, lib, ... }:
|
{ lib, config, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [ ../. ];
|
imports = [ ../. ];
|
||||||
|
|
||||||
# Gnome 40 introduced a new way of managing power, without tlp.
|
config.services.power-profiles-daemon.enable = lib.mkDefault (!config.services.tlp.enable);
|
||||||
# However, these 2 services clash when enabled simultaneously.
|
|
||||||
# https://github.com/NixOS/nixos-hardware/issues/260
|
|
||||||
services.tlp.enable = lib.mkDefault (
|
|
||||||
(lib.versionOlder (lib.versions.majorMinor lib.version) "21.05")
|
|
||||||
|| !config.services.power-profiles-daemon.enable
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
# UCM-iMX95 SOM support
|
||||||
|
|
||||||
|
## Supported devices
|
||||||
|
- [UCM-iMX95 System-on-Module](https://www.compulab.com/products/som-evaluation-kits/ucm-imx95-evaluation-kit/) (**ucm-imx95**) – based on the NXP i.MX95 SoC (A0 silicon), with device-specific boot components(OEI, SM, ATF), U-Boot, and Linux kernel support, including a NixOS configuration example.
|
||||||
|
|
||||||
|
## How to use
|
||||||
|
This overlay provides configuration and hardware support for the **CompuLab UCM-iMX95** platform, based on the **NXP i.MX95 A0 silicon**. It enables generating NixOS images suitable for booting via U-Boot, using the CompuLab UCM-iMX95 Evaluation Kit carrier board.
|
||||||
|
|
||||||
|
### Boot flow
|
||||||
|
The boot flow for the UCM-iMX95 platform follows the standard NXP i.MX95 sequence:
|
||||||
|
|
||||||
|
Boot ROM → OEI (initially in TCM, then DDR) → System Manager (SM) → ARM Trusted Firmware (ATF) → U-Boot → Linux kernel → NixOS userspace
|
||||||
|
|
||||||
|
Boot ROM initializes the SoC and loads OEI, which runs in TCM to perform early setup, then configures DDR and loads the System Manager (SM). SM completes SoC initialization and passes control to ATF, which handles secure world setup and then transfers execution to U-Boot, eventually booting the Linux kernel and NixOS root filesystem.
|
||||||
|
|
||||||
|
### Example NixOS configuration
|
||||||
|
```nix
|
||||||
|
{ nixos-hardware, }: {
|
||||||
|
system = "aarch64-linux";
|
||||||
|
modules = [
|
||||||
|
nixos-hardware.nixosModules.ucm-imx95
|
||||||
|
];
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Building Boot Images
|
||||||
|
|
||||||
|
The boot image for flashing to SD cards can be built directly from the flake:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Build boot image for UCM-iMX95
|
||||||
|
nix build github:NixOS/nixos-hardware#packages.aarch64-linux.ucm-imx95-boot
|
||||||
|
```
|
||||||
|
|
||||||
|
The boot image will be available at `./result/image/flash.bin`.
|
||||||
|
|
||||||
|
**Note:** These packages target `aarch64-linux`. If you're on a different architecture (e.g., x86_64-linux), you'll need remote builders configured for aarch64-linux.
|
||||||
|
|
||||||
|
### Flashing to SD Card
|
||||||
|
|
||||||
|
Once built, you can flash the boot image to an SD card:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Write boot image to SD card at 32KB offset (adjust /dev/sdX to your SD card device)
|
||||||
|
sudo dd if=./result/image/flash.bin of=/dev/sdX bs=1k seek=32 conv=fsync
|
||||||
|
```
|
||||||
|
|
||||||
|
**Warning:** Double-check the device path to avoid overwriting the wrong disk!
|
||||||
|
|
||||||
|
### Notes
|
||||||
|
- The configuration, including device-tree, kernel, and bootloader components, is optimized for the UCM-iMX95 SoM and EVK.
|
||||||
|
- The generated NixOS image supports booting from SD card or eMMC, depending on the hardware configuration.
|
||||||
|
- The boot components (OEI in TCM/DDR, SM, ATF, U-Boot) follow the standard NXP release layout for i.MX95 platforms.
|
||||||
|
|
||||||
|
### Upstream Documentation
|
||||||
|
- [NXP i.MX95 EVK U-Boot Documentation](https://docs.u-boot.org/en/latest/board/nxp/imx95_evk.html)
|
||||||
|
- [CompuLab UCM-iMX95 Product Page](https://www.compulab.com/products/computer-on-modules/ucm-imx95-nxp-i-mx-95-som-system-on-module/)
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
fetchFromGitHub,
|
||||||
|
stdenv,
|
||||||
|
buildPackages,
|
||||||
|
pkgsCross,
|
||||||
|
openssl,
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
target-board = "imx95";
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "imx95-atf";
|
||||||
|
version = "2.13.0";
|
||||||
|
platform = target-board;
|
||||||
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "nxp-imx";
|
||||||
|
repo = "imx-atf";
|
||||||
|
rev = "28affcae957cb8194917b5246276630f9e6343e1";
|
||||||
|
sha256 = "sha256-a8F+Lf8pwML+tCwawS0N/mrSXWPmFhlUeOg0MCRK3VE=";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Compiler dependencies
|
||||||
|
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
||||||
|
nativeBuildInputs = [
|
||||||
|
pkgsCross.aarch64-embedded.stdenv.cc
|
||||||
|
openssl
|
||||||
|
];
|
||||||
|
|
||||||
|
makeFlags = [
|
||||||
|
"HOSTCC=$(CC_FOR_BUILD)"
|
||||||
|
"CROSS_COMPILE=${pkgsCross.aarch64-embedded.stdenv.cc.targetPrefix}"
|
||||||
|
"PLAT=${platform}"
|
||||||
|
"SPD=opteed"
|
||||||
|
"bl31"
|
||||||
|
"LDFLAGS=-no-warn-rwx-segments"
|
||||||
|
];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
mkdir -p $out
|
||||||
|
cp build/${target-board}/release/bl31.bin $out
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
|
hardeningDisable = [ "all" ];
|
||||||
|
dontStrip = true;
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
homepage = "https://github.com/nxp-imx/imx-atf";
|
||||||
|
description = "Reference implementation of secure world software for ARMv8-A";
|
||||||
|
license = licenses.bsd3;
|
||||||
|
maintainers = [
|
||||||
|
{
|
||||||
|
name = "Govind Singh";
|
||||||
|
email = "govind.singh@tii.ae";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
platforms = [ "aarch64-linux" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
{
|
||||||
|
callPackage,
|
||||||
|
fetchFromGitHub,
|
||||||
|
stdenv,
|
||||||
|
clang,
|
||||||
|
git,
|
||||||
|
dtc,
|
||||||
|
glibc,
|
||||||
|
zlib,
|
||||||
|
vim,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
|
||||||
|
imx95-atf = callPackage ./ucm-imx95-atf.nix { };
|
||||||
|
imx95-firmware = callPackage ./ucm-imx95-firmware.nix { };
|
||||||
|
imx95-uboot = callPackage ./ucm-imx95-uboot.nix { };
|
||||||
|
imx95-optee-os = callPackage ./ucm-imx95-optee-os.nix { };
|
||||||
|
imx95-sm-fw = callPackage ./ucm-imx95-sm-fw.nix { };
|
||||||
|
imx95-oei-ddr = callPackage ./ucm-imx95-oei-ddr.nix { };
|
||||||
|
imx95-oei-tcm = callPackage ./ucm-imx95-oei-tcm.nix { };
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "nxp-imx";
|
||||||
|
repo = "imx-mkimage";
|
||||||
|
#tag: lf-6.6.52-2.2.1
|
||||||
|
rev = "f620fb8ef7a04c8dbed8119880f5eeffe3e69746";
|
||||||
|
sha256 = "sha256-JZlX122uZntCIISI1H3Hw+tnk+N/gBJpFFDaZoY8W3c=";
|
||||||
|
};
|
||||||
|
shortRev = builtins.substring 0 8 src.rev;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imx95-boot = stdenv.mkDerivation rec {
|
||||||
|
inherit src;
|
||||||
|
name = "imx95-mkimage";
|
||||||
|
version = "lf-6.6.52-2.2.1";
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace Makefile \
|
||||||
|
--replace-fail 'git rev-parse --short=8 HEAD' 'echo ${shortRev}'
|
||||||
|
substituteInPlace Makefile \
|
||||||
|
--replace-fail 'CC = gcc' 'CC = clang'
|
||||||
|
substituteInPlace iMX95/soc.mak \
|
||||||
|
--replace-fail 'xxd' "${vim.xxd}/bin/xxd"
|
||||||
|
substituteInPlace scripts/fspi_fcb_gen.sh \
|
||||||
|
--replace-fail 'xxd' "${vim.xxd}/bin/xxd"
|
||||||
|
substituteInPlace scripts/fspi_packer.sh \
|
||||||
|
--replace-fail 'xxd' "${vim.xxd}/bin/xxd"
|
||||||
|
patchShebangs scripts
|
||||||
|
'';
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
clang
|
||||||
|
git
|
||||||
|
dtc
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
glibc.static
|
||||||
|
zlib
|
||||||
|
zlib.static
|
||||||
|
];
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
runHook preBuild
|
||||||
|
|
||||||
|
if [ -f ${imx95-uboot}/u-boot.bin ]; then
|
||||||
|
install -m 0644 ${imx95-uboot}/u-boot.bin ./iMX95/u-boot.bin
|
||||||
|
else
|
||||||
|
cat ${imx95-uboot}/u-boot-nodtb.bin ${imx95-uboot}/ucm-imx95.dtb > ./iMX95/u-boot.bin
|
||||||
|
fi
|
||||||
|
install -m 0644 ${imx95-uboot}/u-boot-spl.bin ./iMX95/u-boot-spl.bin
|
||||||
|
install -m 0644 ${imx95-uboot}/u-boot-nodtb.bin ./iMX95/u-boot-nodtb.bin
|
||||||
|
install -m 0644 ${imx95-uboot}/ucm-imx95.dtb ./iMX95/ucm-imx95.dtb
|
||||||
|
install -m 0644 ${imx95-optee-os}/tee.bin ./iMX95/tee.bin
|
||||||
|
install -m 0644 ${imx95-atf}/bl31.bin ./iMX95/bl31.bin
|
||||||
|
install -m 0644 ${imx95-sm-fw}/m33_image.bin ./iMX95/m33_image.bin
|
||||||
|
install -m 0644 ${imx95-oei-ddr}/oei-m33-ddr.bin ./iMX95/oei-m33-ddr.bin
|
||||||
|
install -m 0644 ${imx95-oei-tcm}/oei-m33-tcm.bin ./iMX95/oei-m33-tcm.bin
|
||||||
|
install -m 0644 ${imx95-firmware}/ddr/lpddr5* ./iMX95/
|
||||||
|
install -m 0644 ${imx95-firmware}/ahab/mx95a0-ahab-container.img ./iMX95/
|
||||||
|
install -m 0644 ${imx95-firmware}/m7_image.bin ./iMX95/
|
||||||
|
|
||||||
|
make SOC=iMX95 REV=A0 OEI=YES LPDDR_TYPE=lpddr5 flash_all
|
||||||
|
|
||||||
|
runHook postBuild
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
mkdir -p $out/image
|
||||||
|
install -m 0644 ./iMX95/flash.bin $out/image
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
{
|
||||||
|
stdenv,
|
||||||
|
fetchurl,
|
||||||
|
coreutils,
|
||||||
|
bash,
|
||||||
|
siliconRev ? "A0",
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "nxp-firmware-imx95";
|
||||||
|
version = "nxp-firmware-8.28-994fa14";
|
||||||
|
|
||||||
|
m7Firmware = fetchurl {
|
||||||
|
url = "https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/imx95-m7-demo-25.09.00.bin";
|
||||||
|
sha256 = "sha256-3nA6uka6WPtXH5aZhaaKHKRM0tJ0pxHQdPEupNic1Ks=";
|
||||||
|
};
|
||||||
|
|
||||||
|
ddrFirmware = fetchurl {
|
||||||
|
url = "https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.28-994fa14.bin";
|
||||||
|
sha256 = "sha256-VZlvNA6HglaFoAzTCZARiQZuyVRe5gdzT5QsPN5Nadw=";
|
||||||
|
};
|
||||||
|
|
||||||
|
ahabFirmware = fetchurl {
|
||||||
|
url = "https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-ele-imx-2.0.2-89161a8.bin";
|
||||||
|
sha256 = "sha256-LSnwpN42YroV9qfZBpcC1OrtQV2WoX8p1bEn8sb91jQ=";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
coreutils
|
||||||
|
bash
|
||||||
|
];
|
||||||
|
|
||||||
|
dontUnpack = true;
|
||||||
|
dontStrip = true;
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out
|
||||||
|
export SILICON=${siliconRev}
|
||||||
|
|
||||||
|
# M7 firmware
|
||||||
|
echo "Copying M7 firmware..."
|
||||||
|
cp ${m7Firmware} $out/m7_image.bin
|
||||||
|
|
||||||
|
# DDR firmware
|
||||||
|
cp ${ddrFirmware} ./firmware-imx-8.28-994fa14.bin
|
||||||
|
chmod +x firmware-imx-8.28-994fa14.bin
|
||||||
|
./firmware-imx-8.28-994fa14.bin --auto-accept
|
||||||
|
|
||||||
|
mkdir -p $out/ddr
|
||||||
|
# Resolve wildcard and verify at least one file matches
|
||||||
|
lpddr5_files=(firmware-imx-8.28-994fa14/firmware/ddr/synopsys/lpddr5*v202409.bin)
|
||||||
|
if [ ''${#lpddr5_files[@]} -eq 0 ]; then
|
||||||
|
echo "ERROR: No lpddr5*v202409.bin file found in firmware/ddr/synopsys/" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
cp "''${lpddr5_files[@]}" $out/ddr/
|
||||||
|
|
||||||
|
# AHAB container
|
||||||
|
cp ${ahabFirmware} ./firmware-ele-imx-2.0.2-89161a8.bin
|
||||||
|
chmod +x firmware-ele-imx-2.0.2-89161a8.bin
|
||||||
|
./firmware-ele-imx-2.0.2-89161a8.bin --auto-accept
|
||||||
|
|
||||||
|
mkdir -p $out/ahab
|
||||||
|
if [ "$SILICON" = "A0" ]; then
|
||||||
|
cp firmware-ele-imx-2.0.2-89161a8/mx95a0-ahab-container.img $out/ahab/
|
||||||
|
elif [ "$SILICON" = "B0" ]; then
|
||||||
|
cp firmware-ele-imx-2.0.2-89161a8/mx95b0-ahab-container.img $out/ahab/
|
||||||
|
else
|
||||||
|
echo "ERROR: Invalid SILICON value '$SILICON'. Must be 'A0' or 'B0'." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
}
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
buildLinux,
|
||||||
|
fetchFromGitHub,
|
||||||
|
...
|
||||||
|
}@args:
|
||||||
|
buildLinux (
|
||||||
|
args
|
||||||
|
// rec {
|
||||||
|
version = "6.6.36";
|
||||||
|
name = "imx95-linux";
|
||||||
|
|
||||||
|
# modDirVersion needs to be x.y.z, will automatically add .0 if needed
|
||||||
|
modDirVersion = version;
|
||||||
|
|
||||||
|
defconfig = "compulab-mx95_defconfig";
|
||||||
|
|
||||||
|
# https://github.com/NixOS/nixpkgs/pull/366004
|
||||||
|
# introduced a breaking change that if a module is declared but it is not being used it will fail.
|
||||||
|
ignoreConfigErrors = true;
|
||||||
|
|
||||||
|
kernelPatches = [
|
||||||
|
];
|
||||||
|
|
||||||
|
autoModules = false;
|
||||||
|
|
||||||
|
extraConfig = ''
|
||||||
|
CRYPTO_TLS m
|
||||||
|
TLS y
|
||||||
|
MD_RAID0 m
|
||||||
|
MD_RAID1 m
|
||||||
|
MD_RAID10 m
|
||||||
|
MD_RAID456 m
|
||||||
|
DM_VERITY m
|
||||||
|
LOGO y
|
||||||
|
FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER n
|
||||||
|
FB_EFI n
|
||||||
|
EFI_STUB y
|
||||||
|
EFI y
|
||||||
|
VIRTIO y
|
||||||
|
VIRTIO_PCI y
|
||||||
|
VIRTIO_BLK y
|
||||||
|
DRM_VIRTIO_GPU y
|
||||||
|
EXT4_FS y
|
||||||
|
USBIP_CORE m
|
||||||
|
USBIP_VHCI_HCD m
|
||||||
|
USBIP_HOST m
|
||||||
|
USBIP_VUDC m
|
||||||
|
'';
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "compulab-yokneam";
|
||||||
|
repo = "linux-compulab";
|
||||||
|
# tag: linux-compulab_6.6.36
|
||||||
|
rev = "b93daaad0807fb15d4f3f1a6e5be843ac7532ef7";
|
||||||
|
sha256 = "sha256-wCeuGXBTz3H6OFWBA1M1/t/9WgxBVjQ8FU/wvAUVW2w=";
|
||||||
|
};
|
||||||
|
meta = with lib; {
|
||||||
|
homepage = "https://github.com/compulab-yokneam/linux-compulab";
|
||||||
|
license = licenses.gpl2Only;
|
||||||
|
maintainers = [
|
||||||
|
{
|
||||||
|
name = "Govind Singh";
|
||||||
|
email = "govind.singh@tii.ae";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
platforms = [ "aarch64-linux" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
// (args.argsOverride or { })
|
||||||
|
)
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
stdenv,
|
||||||
|
buildPackages,
|
||||||
|
gcc-arm-embedded,
|
||||||
|
fetchFromGitHub,
|
||||||
|
fetchpatch,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
metaBspImx95Rev = "5f4c7b5db846fa3a75055054e32215089d15a7b7"; # scarthgap
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "imx95-imx-oei";
|
||||||
|
version = "lf-6.6.36-2.1.0";
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
buildPackages.python3
|
||||||
|
gcc-arm-embedded
|
||||||
|
];
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "nxp-imx";
|
||||||
|
repo = "imx-oei";
|
||||||
|
rev = "5fca9f47544d03c52ca371eadfffbfd2454e6925";
|
||||||
|
sha256 = "sha256-Sb6u1NlhJpDCOKBu3HqUb4BLEy0F8LYVnJE0tRSvzWc=";
|
||||||
|
};
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/${metaBspImx95Rev}/recipes-bsp/imx-oei/imx-oei/0001-Add-CompuLab-lpddr5_timing.c.patch";
|
||||||
|
sha256 = "sha256-6ZpBOXw2aIhD2i9Wx368xfHq6NvdZghWHU9u8+gRTj8=";
|
||||||
|
})
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/${metaBspImx95Rev}/recipes-bsp/imx-oei/imx-oei/0002-board-mx95lp5-Fix-default-DDR_CONFIG-timing-name.patch";
|
||||||
|
sha256 = "sha256-WZ/vYaTC2iKIC+jnHtnPriCxK9gjRsOv2Uy13Ye4698=";
|
||||||
|
})
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/${metaBspImx95Rev}/recipes-bsp/imx-oei/imx-oei/0003-Add-CompuLab-lpddr5_timing_4g.c.patch";
|
||||||
|
sha256 = "sha256-yyierv2USZlM8Cuxf4FDj4+UtILvJQH9BJSj+fmayL8=";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace oei/makefiles/build_info.mak \
|
||||||
|
--replace-fail "/bin/echo" "echo"
|
||||||
|
substituteInPlace Makefile \
|
||||||
|
--replace-fail "/bin/echo" "echo"
|
||||||
|
'';
|
||||||
|
|
||||||
|
makeFlags = [
|
||||||
|
"board=mx95lp5"
|
||||||
|
"CROSS_COMPILE=${gcc-arm-embedded}/bin/arm-none-eabi-"
|
||||||
|
"OEI_CROSS_COMPILE=${gcc-arm-embedded}/bin/arm-none-eabi-"
|
||||||
|
"ARCH=arm"
|
||||||
|
"DDR_CONFIG=lpddr5_timing"
|
||||||
|
"oei=ddr"
|
||||||
|
];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out
|
||||||
|
cp build/mx95lp5/ddr/oei-m33-ddr.bin $out/
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
homepage = "https://github.com/nxp-imx/imx-oei";
|
||||||
|
description = "Optional Executable Image assembler for i.MX95 processors";
|
||||||
|
license = licenses.bsd3;
|
||||||
|
maintainers = [
|
||||||
|
{
|
||||||
|
name = "Govind Singh";
|
||||||
|
email = "govind.singh@tii.ae";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
platforms = [ "aarch64-linux" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
stdenv,
|
||||||
|
buildPackages,
|
||||||
|
gcc-arm-embedded,
|
||||||
|
fetchFromGitHub,
|
||||||
|
fetchpatch,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
metaBspImx95Rev = "5f4c7b5db846fa3a75055054e32215089d15a7b7"; # scarthgap
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "imx95-imx-oei-tcm";
|
||||||
|
version = "lf-6.6.36-2.1.0";
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
buildPackages.python3
|
||||||
|
gcc-arm-embedded
|
||||||
|
];
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "nxp-imx";
|
||||||
|
repo = "imx-oei";
|
||||||
|
rev = "5fca9f47544d03c52ca371eadfffbfd2454e6925";
|
||||||
|
sha256 = "sha256-Sb6u1NlhJpDCOKBu3HqUb4BLEy0F8LYVnJE0tRSvzWc=";
|
||||||
|
};
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/${metaBspImx95Rev}/recipes-bsp/imx-oei/imx-oei/0001-Add-CompuLab-lpddr5_timing.c.patch";
|
||||||
|
sha256 = "sha256-6ZpBOXw2aIhD2i9Wx368xfHq6NvdZghWHU9u8+gRTj8=";
|
||||||
|
})
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/${metaBspImx95Rev}/recipes-bsp/imx-oei/imx-oei/0002-board-mx95lp5-Fix-default-DDR_CONFIG-timing-name.patch";
|
||||||
|
sha256 = "sha256-WZ/vYaTC2iKIC+jnHtnPriCxK9gjRsOv2Uy13Ye4698=";
|
||||||
|
})
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/${metaBspImx95Rev}/recipes-bsp/imx-oei/imx-oei/0003-Add-CompuLab-lpddr5_timing_4g.c.patch";
|
||||||
|
sha256 = "sha256-yyierv2USZlM8Cuxf4FDj4+UtILvJQH9BJSj+fmayL8=";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace oei/makefiles/build_info.mak \
|
||||||
|
--replace-fail "/bin/echo" "echo"
|
||||||
|
substituteInPlace Makefile \
|
||||||
|
--replace-fail "/bin/echo" "echo"
|
||||||
|
'';
|
||||||
|
|
||||||
|
makeFlags = [
|
||||||
|
"board=mx95lp5"
|
||||||
|
"CROSS_COMPILE=${gcc-arm-embedded}/bin/arm-none-eabi-"
|
||||||
|
"OEI_CROSS_COMPILE=${gcc-arm-embedded}/bin/arm-none-eabi-"
|
||||||
|
"ARCH=arm"
|
||||||
|
"DDR_CONFIG=lpddr5_timing"
|
||||||
|
"oei=tcm"
|
||||||
|
];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out
|
||||||
|
cp build/mx95lp5/tcm/oei-m33-tcm.bin $out/
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
homepage = "https://github.com/nxp-imx/imx-oei";
|
||||||
|
description = "Optional Executable Image assembler for i.MX95 processors";
|
||||||
|
license = licenses.bsd3;
|
||||||
|
maintainers = [
|
||||||
|
{
|
||||||
|
name = "Govind Singh";
|
||||||
|
email = "govind.singh@tii.ae";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
platforms = [ "aarch64-linux" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
stdenv,
|
||||||
|
fetchFromGitHub,
|
||||||
|
buildPackages,
|
||||||
|
bash,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
inherit (buildPackages) python3;
|
||||||
|
toolchain = stdenv.cc;
|
||||||
|
binutils = stdenv.cc.bintools.bintools_bin;
|
||||||
|
cpp = stdenv.cc;
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
pname = "imx95-optee-os";
|
||||||
|
version = "lf-6.6.36_2.1.0";
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
python3
|
||||||
|
];
|
||||||
|
|
||||||
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
propagatedBuildInputs = with python3.pkgs; [
|
||||||
|
pycryptodomex
|
||||||
|
pyelftools
|
||||||
|
cryptography
|
||||||
|
];
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "nxp-imx";
|
||||||
|
repo = "imx-optee-os";
|
||||||
|
rev = "612bc5a642a4608d282abeee2349d86de996d7ee";
|
||||||
|
sha256 = "sha256-l8GKkrlBs5kgw6jrzGLT9WAeTSDqo8XWZDFT2+Fisv4=";
|
||||||
|
};
|
||||||
|
meta = with lib; {
|
||||||
|
homepage = "https://github.com/nxp-imx/imx-optee-os";
|
||||||
|
license = licenses.bsd2;
|
||||||
|
maintainers = [
|
||||||
|
{
|
||||||
|
name = "Govind Singh";
|
||||||
|
email = "govind.singh@tii.ae";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
platforms = [ "aarch64-linux" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace scripts/arm32_sysreg.py \
|
||||||
|
--replace-fail '/usr/bin/env python3' '${python3}/bin/python'
|
||||||
|
substituteInPlace scripts/gen_tee_bin.py \
|
||||||
|
--replace-fail '/usr/bin/env python3' '${python3}/bin/python'
|
||||||
|
substituteInPlace scripts/pem_to_pub_c.py \
|
||||||
|
--replace-fail '/usr/bin/env python3' '${python3}/bin/python'
|
||||||
|
substituteInPlace ta/pkcs11/scripts/verify-helpers.sh \
|
||||||
|
--replace-fail '/bin/bash' '${bash}/bin/bash'
|
||||||
|
substituteInPlace mk/gcc.mk \
|
||||||
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))objcopy" ${binutils}/bin/${toolchain.targetPrefix}objcopy
|
||||||
|
substituteInPlace mk/gcc.mk \
|
||||||
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))objdump" ${binutils}/bin/${toolchain.targetPrefix}objdump
|
||||||
|
substituteInPlace mk/gcc.mk \
|
||||||
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))nm" ${binutils}/bin/${toolchain.targetPrefix}nm
|
||||||
|
substituteInPlace mk/gcc.mk \
|
||||||
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))readelf" ${binutils}/bin/${toolchain.targetPrefix}readelf
|
||||||
|
substituteInPlace mk/gcc.mk \
|
||||||
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))ar" ${binutils}/bin/${toolchain.targetPrefix}ar
|
||||||
|
substituteInPlace mk/gcc.mk \
|
||||||
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))cpp" ${cpp}/bin/${toolchain.targetPrefix}cpp
|
||||||
|
'';
|
||||||
|
|
||||||
|
makeFlags = [
|
||||||
|
"PLATFORM=imx-mx95evk"
|
||||||
|
"CFG_ARM64_core=y"
|
||||||
|
"CFG_TEE_TA_LOG_LEVEL=0"
|
||||||
|
"CFG_TEE_CORE_LOG_LEVEL=0"
|
||||||
|
"CROSS_COMPILE=${toolchain}/bin/${toolchain.targetPrefix}"
|
||||||
|
"CROSS_COMPILE64=${toolchain}/bin/${toolchain.targetPrefix}"
|
||||||
|
];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out
|
||||||
|
cp ./out/arm-plat-imx/core/tee-raw.bin $out/tee.bin
|
||||||
|
'';
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
stdenv,
|
||||||
|
buildPackages,
|
||||||
|
gcc-arm-embedded,
|
||||||
|
fetchFromGitHub,
|
||||||
|
fetchpatch,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
metaBspImx95Rev = "224eed17cddc573061150e9d2ce6f9acb39ea50e"; # scarthgap-6.6.36-EVAL-UCM-iMX95-1.0
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "imx95-sm-fw";
|
||||||
|
version = "lf-6.6.36-2.1.0";
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
buildPackages.python3
|
||||||
|
gcc-arm-embedded
|
||||||
|
];
|
||||||
|
|
||||||
|
propagatedBuildInputs = with buildPackages.python3.pkgs; [
|
||||||
|
pycryptodomex
|
||||||
|
pyelftools
|
||||||
|
cryptography
|
||||||
|
];
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "nxp-imx";
|
||||||
|
repo = "imx-sm";
|
||||||
|
rev = "709deccd9338399eb39b5cf99a60eab4fa60d539";
|
||||||
|
sha256 = "sha256-02Cl+XhWGSFswspdBJ/4B/mBm4XTs/qKotx0BXMQpJk=";
|
||||||
|
};
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/${metaBspImx95Rev}/recipes-bsp/imx-system-manager/imx-system-manager/0001-Add-mcimx95cust-board.patch";
|
||||||
|
sha256 = "sha256-zvZ4bNew+yRPmaZQMrAH087KpCLRqz6zdElfe72Dtuc=";
|
||||||
|
})
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/${metaBspImx95Rev}/recipes-bsp/imx-system-manager/imx-system-manager/0002-Fix-null-pionter-except.patch";
|
||||||
|
sha256 = "sha256-q72VEvJqm2CmOxdWMqGibgXS5lY08mC4srEcy00QdrE=";
|
||||||
|
})
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/${metaBspImx95Rev}/recipes-bsp/imx-system-manager/imx-system-manager/0001-update-for-yocto-6.6.36-compatibility.patch";
|
||||||
|
sha256 = "sha256-JzHqDiD/ZOu6VQQI0JxY17RQ3bA2t1aP3O1sjLPguWs=";
|
||||||
|
})
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/${metaBspImx95Rev}/recipes-bsp/imx-system-manager/imx-system-manager/0003-sm-Disable-GPIO1-10-interrupt.patch";
|
||||||
|
sha256 = "sha256-dhcDv7Uq856+MBonczMPznk+tuqUFxTcHiKLX+myCVA=";
|
||||||
|
})
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/${metaBspImx95Rev}/recipes-bsp/imx-system-manager/imx-system-manager/0004-configs-mx95cust-change-LPTPM1-ownership.patch";
|
||||||
|
sha256 = "sha256-NcLu6+zXpiSz1bHKW14Zuf6F/4pzKsekb+zaRtKjSTY=";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace sm/makefiles/gcc_cross.mak \
|
||||||
|
--replace-fail "\$(SM_CROSS_COMPILE)objcopy" ${gcc-arm-embedded}/bin/arm-none-eabi-objcopy
|
||||||
|
substituteInPlace sm/makefiles/build_info.mak \
|
||||||
|
--replace-fail "/bin/echo" "echo"
|
||||||
|
substituteInPlace sm/makefiles/gcc_cross.mak \
|
||||||
|
--replace-fail 'SM_CROSS_COMPILE ?= $(TOOLS)/arm-gnu-toolchain-*-none-eabi/bin/arm-none-eabi-' \
|
||||||
|
'SM_CROSS_COMPILE ?= $(CROSS_COMPILE)'
|
||||||
|
'';
|
||||||
|
|
||||||
|
makeFlags = [
|
||||||
|
"config=mx95cust"
|
||||||
|
"M=2"
|
||||||
|
"CROSS_COMPILE=${gcc-arm-embedded}/bin/arm-none-eabi-"
|
||||||
|
"CROSS_COMPILE64=${gcc-arm-embedded}/bin/arm-none-eabi-"
|
||||||
|
"ARCH=arm"
|
||||||
|
];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out
|
||||||
|
cp build/mx95cust/m33_image.bin $out/
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
homepage = "https://github.com/nxp-imx/imx-sm";
|
||||||
|
description = "System Manager firmware for i.MX processors";
|
||||||
|
license = licenses.bsd3;
|
||||||
|
maintainers = [
|
||||||
|
{
|
||||||
|
name = "Govind Singh";
|
||||||
|
email = "govind.singh@tii.ae";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
platforms = [ "aarch64-linux" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
{
|
||||||
|
stdenv,
|
||||||
|
lib,
|
||||||
|
bison,
|
||||||
|
dtc,
|
||||||
|
fetchFromGitHub,
|
||||||
|
flex,
|
||||||
|
gnutls,
|
||||||
|
libuuid,
|
||||||
|
ncurses,
|
||||||
|
openssl,
|
||||||
|
which,
|
||||||
|
perl,
|
||||||
|
buildPackages,
|
||||||
|
efitools,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
ubsrc = fetchFromGitHub {
|
||||||
|
owner = "compulab-yokneam";
|
||||||
|
repo = "u-boot-compulab";
|
||||||
|
# tag: lf_v2024.04
|
||||||
|
rev = "824401fe487d7d3cbcf251bd60270bd7fe8d21d0";
|
||||||
|
sha256 = "sha256-m+YW7+XF/jcNKfyb5533LXGyOWvStqY+MCczAdcNGZI=";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
pname = "imx95-uboot";
|
||||||
|
version = "2024.04";
|
||||||
|
src = ubsrc;
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
patchShebangs tools
|
||||||
|
patchShebangs scripts
|
||||||
|
'';
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
bison
|
||||||
|
flex
|
||||||
|
openssl
|
||||||
|
which
|
||||||
|
ncurses
|
||||||
|
libuuid
|
||||||
|
gnutls
|
||||||
|
openssl
|
||||||
|
perl
|
||||||
|
efitools
|
||||||
|
];
|
||||||
|
|
||||||
|
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
||||||
|
hardeningDisable = [ "all" ];
|
||||||
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
makeFlags = [
|
||||||
|
"DTC=${lib.getExe buildPackages.dtc}"
|
||||||
|
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
|
||||||
|
];
|
||||||
|
|
||||||
|
extraConfig = ''
|
||||||
|
CONFIG_USE_BOOTCOMMAND=y
|
||||||
|
CONFIG_BOOTCOMMAND="setenv ramdisk_addr_r 0x97000000; setenv fdt_addr_r 0x96000000; run distro_bootcmd; "
|
||||||
|
CONFIG_CMD_BOOTEFI_SELFTEST=y
|
||||||
|
CONFIG_CMD_BOOTEFI=y
|
||||||
|
CONFIG_EFI_LOADER=y
|
||||||
|
CONFIG_BLK=y
|
||||||
|
CONFIG_PARTITIONS=y
|
||||||
|
CONFIG_DM_DEVICE_REMOVE=n
|
||||||
|
CONFIG_CMD_CACHE=y
|
||||||
|
'';
|
||||||
|
|
||||||
|
passAsFile = [ "extraConfig" ];
|
||||||
|
|
||||||
|
configurePhase = ''
|
||||||
|
runHook preConfigure
|
||||||
|
|
||||||
|
make ucm-imx95_defconfig
|
||||||
|
cat $extraConfigPath >> .config
|
||||||
|
make olddefconfig
|
||||||
|
|
||||||
|
runHook postConfigure
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
mkdir -p $out
|
||||||
|
cp ./u-boot-nodtb.bin $out
|
||||||
|
cp ./spl/u-boot-spl.bin $out
|
||||||
|
cp ./arch/arm/dts/ucm-imx95.dtb $out
|
||||||
|
cp .config $out
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
|
dontStrip = true;
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
(import ./overlay.nix)
|
||||||
|
];
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
./modules.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.loader.grub.extraFiles = {
|
||||||
|
"ucm-imx95.dtb" = "${pkgs.callPackage ./bsp/ucm-imx95-linux.nix { }}/dtbs/compulab/ucm-imx95.dtb";
|
||||||
|
};
|
||||||
|
|
||||||
|
hardware.deviceTree = {
|
||||||
|
filter = "ucm-imx95.dtb";
|
||||||
|
name = "ucm-imx95.dtb";
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
nixpkgs.hostPlatform.system = "aarch64-linux";
|
||||||
|
|
||||||
|
boot = {
|
||||||
|
kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./bsp/ucm-imx95-linux.nix { });
|
||||||
|
initrd.includeDefaultModules = lib.mkForce false;
|
||||||
|
};
|
||||||
|
|
||||||
|
disabledModules = [ "profiles/all-hardware.nix" ];
|
||||||
|
|
||||||
|
hardware.deviceTree.enable = true;
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
final: _prev: {
|
||||||
|
inherit (final.callPackage ./bsp/ucm-imx95-boot.nix { }) imx95-boot;
|
||||||
|
}
|
||||||
@@ -8,6 +8,3 @@
|
|||||||
`fwupd` is used to receive firmware updates from vendors. This device is in its [supported devices list](https://fwupd.org/lvfs/devices/)
|
`fwupd` is used to receive firmware updates from vendors. This device is in its [supported devices list](https://fwupd.org/lvfs/devices/)
|
||||||
|
|
||||||
`thermald` is used to achieve better thermal behaviour
|
`thermald` is used to achieve better thermal behaviour
|
||||||
|
|
||||||
##### TLP
|
|
||||||
TLP is a battery power optimizer for laptops. It is enabled by default, however, since it conflicts with power-profiles-daemon which is GNOME's power management system, TLP will not be installed with if power-profiles-daemon or a recent version of GNOME is present.
|
|
||||||
@@ -6,16 +6,8 @@
|
|||||||
../../../common/pc/laptop
|
../../../common/pc/laptop
|
||||||
];
|
];
|
||||||
|
|
||||||
hardware.enableAllFirmware = lib.mkDefault true;
|
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
fwupd.enable = lib.mkDefault true;
|
fwupd.enable = lib.mkDefault true;
|
||||||
thermald.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 ];
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
@@ -13,11 +13,8 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
# needs to be explicitly loaded or else bluetooth/wifi won't work
|
|
||||||
kernelModules = [
|
kernelModules = [
|
||||||
"kvm-intel"
|
"kvm-intel"
|
||||||
"wl"
|
|
||||||
];
|
];
|
||||||
extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,39 @@
|
|||||||
description = "nixos-hardware";
|
description = "nixos-hardware";
|
||||||
|
|
||||||
outputs =
|
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 =
|
nixosModules =
|
||||||
@@ -43,12 +75,14 @@
|
|||||||
asus-flow-gv302x-amdgpu = import ./asus/flow/gv302x/amdgpu;
|
asus-flow-gv302x-amdgpu = import ./asus/flow/gv302x/amdgpu;
|
||||||
asus-flow-gv302x-nvidia = import ./asus/flow/gv302x/nvidia;
|
asus-flow-gv302x-nvidia = import ./asus/flow/gv302x/nvidia;
|
||||||
asus-pro-ws-x570-ace = import ./asus/pro-ws-x570-ace;
|
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-g513im = import ./asus/rog-strix/g513im;
|
||||||
asus-rog-strix-g533zw = import ./asus/rog-strix/g533zw;
|
asus-rog-strix-g533zw = import ./asus/rog-strix/g533zw;
|
||||||
asus-rog-strix-g533q = import ./asus/rog-strix/g533q;
|
asus-rog-strix-g533q = import ./asus/rog-strix/g533q;
|
||||||
asus-rog-strix-g713ie = import ./asus/rog-strix/g713ie;
|
asus-rog-strix-g713ie = import ./asus/rog-strix/g713ie;
|
||||||
asus-rog-strix-g733qs = import ./asus/rog-strix/g733qs;
|
asus-rog-strix-g733qs = import ./asus/rog-strix/g733qs;
|
||||||
asus-rog-strix-x570e = import ./asus/rog-strix/x570e;
|
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-ux371 = import ./asus/zenbook/ux371;
|
||||||
asus-zenbook-ux535 = import ./asus/zenbook/ux535;
|
asus-zenbook-ux535 = import ./asus/zenbook/ux535;
|
||||||
asus-zenbook-ux481-intelgpu = import ./asus/zenbook/ux481/intelgpu;
|
asus-zenbook-ux481-intelgpu = import ./asus/zenbook/ux481/intelgpu;
|
||||||
@@ -218,6 +252,7 @@
|
|||||||
lenovo-thinkpad-p14s-amd-gen3 = import ./lenovo/thinkpad/p14s/amd/gen3;
|
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-gen4 = import ./lenovo/thinkpad/p14s/amd/gen4;
|
||||||
lenovo-thinkpad-p14s-amd-gen5 = import ./lenovo/thinkpad/p14s/amd/gen5;
|
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-gen3 = import ./lenovo/thinkpad/p14s/intel/gen3;
|
||||||
lenovo-thinkpad-p14s-intel-gen5 = import ./lenovo/thinkpad/p14s/intel/gen5;
|
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-gen1 = import ./lenovo/thinkpad/p16s/amd/gen1;
|
||||||
@@ -303,6 +338,7 @@
|
|||||||
lenovo-yoga-7-14IAH7-hybrid = import ./lenovo/yoga/7/14IAH7/hybrid;
|
lenovo-yoga-7-14IAH7-hybrid = import ./lenovo/yoga/7/14IAH7/hybrid;
|
||||||
lenovo-yoga-7-14ILL10 = import ./lenovo/yoga/7/14ILL10;
|
lenovo-yoga-7-14ILL10 = import ./lenovo/yoga/7/14ILL10;
|
||||||
lenovo-yoga-7-slim-gen8 = import ./lenovo/yoga/7/slim/gen8;
|
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;
|
letsnote-cf-lx4 = import ./panasonic/letsnote/cf-lx4;
|
||||||
linglong-nova-studio = import ./linglong/nova-studio;
|
linglong-nova-studio = import ./linglong/nova-studio;
|
||||||
malibal-aon-s1-intel = import ./malibal/aon/s1;
|
malibal-aon-s1-intel = import ./malibal/aon/s1;
|
||||||
@@ -320,12 +356,15 @@
|
|||||||
morefine-m600 = import ./morefine/m600;
|
morefine-m600 = import ./morefine/m600;
|
||||||
msi-b350-tomahawk = import ./msi/b350-tomahawk;
|
msi-b350-tomahawk = import ./msi/b350-tomahawk;
|
||||||
msi-b550-a-pro = import ./msi/b550-a-pro;
|
msi-b550-a-pro = import ./msi/b550-a-pro;
|
||||||
|
msi-b550-tomahawk = import ./msi/b550-tomahawk;
|
||||||
msi-gs60 = import ./msi/gs60;
|
msi-gs60 = import ./msi/gs60;
|
||||||
msi-gl62 = import ./msi/gl62;
|
msi-gl62 = import ./msi/gl62;
|
||||||
msi-gl65-10SDR-492 = import ./msi/gl65/10SDR-492;
|
msi-gl65-10SDR-492 = import ./msi/gl65/10SDR-492;
|
||||||
nxp-imx8mp-evk = import ./nxp/imx8mp-evk;
|
nxp-imx8mp-evk = import ./nxp/imx8mp-evk;
|
||||||
nxp-imx8mq-evk = import ./nxp/imx8mq-evk;
|
nxp-imx8mq-evk = import ./nxp/imx8mq-evk;
|
||||||
nxp-imx8qm-mek = import ./nxp/imx8qm-mek;
|
nxp-imx8qm-mek = import ./nxp/imx8qm-mek;
|
||||||
|
nxp-imx93-evk = import ./nxp/imx93-evk;
|
||||||
|
ucm-imx95 = import ./compulab/ucm-imx95;
|
||||||
hardkernel-odroid-hc4 = import ./hardkernel/odroid-hc4;
|
hardkernel-odroid-hc4 = import ./hardkernel/odroid-hc4;
|
||||||
hardkernel-odroid-h3 = import ./hardkernel/odroid-h3;
|
hardkernel-odroid-h3 = import ./hardkernel/odroid-h3;
|
||||||
hardkernel-odroid-h4 = import ./hardkernel/odroid-h4;
|
hardkernel-odroid-h4 = import ./hardkernel/odroid-h4;
|
||||||
@@ -414,5 +453,48 @@
|
|||||||
common-pc-laptop-ssd = import ./common/pc/ssd;
|
common-pc-laptop-ssd = import ./common/pc/ssd;
|
||||||
common-pc-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;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
// pkgs.lib.optionalAttrs (system == "aarch64-linux") {
|
||||||
|
# Boot images for NXP i.MX boards (aarch64-linux only)
|
||||||
|
ucm-imx95-boot = (pkgs.callPackage ./compulab/ucm-imx95/bsp/ucm-imx95-boot.nix { }).imx95-boot;
|
||||||
|
imx93-boot = (pkgs.callPackage ./nxp/imx93-evk/bsp/imx93-boot.nix { }).imx93-boot;
|
||||||
|
imx8mp-boot = (pkgs.callPackage ./nxp/imx8mp-evk/bsp/imx8mp-boot.nix { }).imx8m-boot;
|
||||||
|
imx8mq-boot = (pkgs.callPackage ./nxp/imx8mq-evk/bsp/imx8mq-boot.nix { }).imx8m-boot;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
# 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
|
||||||
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -6,8 +6,7 @@
|
|||||||
../../../common/gpu/amd
|
../../../common/gpu/amd
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.kernelParams =
|
boot.kernelParams = [
|
||||||
[
|
|
||||||
# There seems to be an issue with panel self-refresh (PSR) that
|
# There seems to be an issue with panel self-refresh (PSR) that
|
||||||
# causes hangs for users.
|
# causes hangs for users.
|
||||||
#
|
#
|
||||||
@@ -19,8 +18,4 @@
|
|||||||
++ lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8") [
|
++ lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8") [
|
||||||
"rtc_cmos.use_acpi_alarm=1"
|
"rtc_cmos.use_acpi_alarm=1"
|
||||||
];
|
];
|
||||||
|
|
||||||
# AMD has better battery life with PPD over TLP:
|
|
||||||
# https://community.frame.work/t/responded-amd-7040-sleep-states/38101/13
|
|
||||||
services.power-profiles-daemon.enable = lib.mkDefault true;
|
|
||||||
}
|
}
|
||||||
@@ -9,8 +9,7 @@
|
|||||||
../../../common/cpu/intel
|
../../../common/cpu/intel
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.kernelParams =
|
boot.kernelParams = [
|
||||||
[
|
|
||||||
# For Power consumption
|
# For Power consumption
|
||||||
# https://community.frame.work/t/linux-battery-life-tuning/6665/156
|
# https://community.frame.work/t/linux-battery-life-tuning/6665/156
|
||||||
"nvme.noacpi=1"
|
"nvme.noacpi=1"
|
||||||
|
|||||||
@@ -20,30 +20,6 @@
|
|||||||
lib.mkDefault pkgs.linuxPackages_latest
|
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 =
|
hardware.framework.laptop13.audioEnhancement.rawDeviceName =
|
||||||
lib.mkDefault "alsa_output.pci-0000_00_1f.3.analog-stereo";
|
lib.mkDefault "alsa_output.pci-0000_00_1f.3.analog-stereo";
|
||||||
}
|
}
|
||||||
@@ -6,8 +6,7 @@
|
|||||||
../../../common/gpu/amd
|
../../../common/gpu/amd
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.kernelParams =
|
boot.kernelParams = [
|
||||||
[
|
|
||||||
# There seems to be an issue with panel self-refresh (PSR) that
|
# There seems to be an issue with panel self-refresh (PSR) that
|
||||||
# causes hangs for users.
|
# causes hangs for users.
|
||||||
#
|
#
|
||||||
@@ -19,8 +18,4 @@
|
|||||||
++ lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8") [
|
++ lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8") [
|
||||||
"rtc_cmos.use_acpi_alarm=1"
|
"rtc_cmos.use_acpi_alarm=1"
|
||||||
];
|
];
|
||||||
|
|
||||||
# AMD has better battery life with PPD over TLP:
|
|
||||||
# https://community.frame.work/t/responded-amd-7040-sleep-states/38101/13
|
|
||||||
services.power-profiles-daemon.enable = lib.mkDefault true;
|
|
||||||
}
|
}
|
||||||
+13
-34
@@ -1,22 +1,26 @@
|
|||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
|
||||||
kernel_version_compatible = lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.10";
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
options.hardware.framework.enableKmod =
|
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
|
# 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;
|
default = lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.10";
|
||||||
defaultText = "enabled by default on NixOS >= 24.05 and kernel >= 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; [
|
extraModulePackages = with config.boot.kernelPackages; [
|
||||||
framework-laptop-kmod
|
framework-laptop-kmod
|
||||||
];
|
];
|
||||||
@@ -26,31 +30,6 @@ in
|
|||||||
"cros_ec"
|
"cros_ec"
|
||||||
"cros_ec_lpcs"
|
"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"
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -10,11 +10,6 @@
|
|||||||
"video=eDP-1:panel_orientation=right_side_up"
|
"video=eDP-1:panel_orientation=right_side_up"
|
||||||
];
|
];
|
||||||
|
|
||||||
services.tlp.enable = lib.mkDefault (
|
|
||||||
(lib.versionOlder (lib.versions.majorMinor lib.version) "21.05")
|
|
||||||
|| !config.services.power-profiles-daemon.enable
|
|
||||||
);
|
|
||||||
|
|
||||||
# Required for grub to properly display the boot menu.
|
# Required for grub to properly display the boot menu.
|
||||||
boot.loader.grub.gfxmodeEfi = lib.mkDefault "720x1280x32";
|
boot.loader.grub.gfxmodeEfi = lib.mkDefault "720x1280x32";
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ in
|
|||||||
|
|
||||||
nixpkgs.overlays = [ (import ./overlay.nix) ];
|
nixpkgs.overlays = [ (import ./overlay.nix) ];
|
||||||
|
|
||||||
nixpkgs.hostPlatform = "armv7l-linux";
|
nixpkgs.hostPlatform.system = "armv7l-linux";
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "ahci_mvebu" ];
|
boot.initrd.availableKernelModules = [ "ahci_mvebu" ];
|
||||||
|
|
||||||
|
|||||||
@@ -17,9 +17,4 @@
|
|||||||
|
|
||||||
# Cooling management
|
# Cooling management
|
||||||
services.thermald.enable = lib.mkDefault true;
|
services.thermald.enable = lib.mkDefault true;
|
||||||
|
|
||||||
# tlp defaults to "powersave", which doesn't exist on this laptop
|
|
||||||
services.tlp.settings = {
|
|
||||||
CPU_SCALING_GOVERNOR_ON_BAT = "schedutil";
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
@@ -10,8 +10,7 @@
|
|||||||
# remove all packages for amd igpu. I only removed amdgpu from
|
# remove all packages for amd igpu. I only removed amdgpu from
|
||||||
# services.xserver.videoDrivers by overriding. This is because the specialization
|
# services.xserver.videoDrivers by overriding. This is because the specialization
|
||||||
# of nix cannot implement such an operation as canceling an import.
|
# of nix cannot implement such an operation as canceling an import.
|
||||||
hardware =
|
hardware = {
|
||||||
{
|
|
||||||
nvidia.prime.offload.enable = false;
|
nvidia.prime.offload.enable = false;
|
||||||
}
|
}
|
||||||
// lib.optionalAttrs (options ? amdgpu.opencl.enable) {
|
// lib.optionalAttrs (options ? amdgpu.opencl.enable) {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
# This file was obtained from the display while "DDG" mode was enabled.
|
# This file was obtained from the display while "DDG" mode was enabled.
|
||||||
chip_edid = pkgs.runCommandNoCC "chip_edid" { } ''
|
chip_edid = pkgs.runCommand "chip_edid" { } ''
|
||||||
mkdir -p $out/lib/firmware/edid
|
mkdir -p $out/lib/firmware/edid
|
||||||
cp ${./16ach6h.bin} $out/lib/firmware/edid/16ach6h.bin
|
cp ${./16ach6h.bin} $out/lib/firmware/edid/16ach6h.bin
|
||||||
'';
|
'';
|
||||||
|
|||||||
@@ -10,8 +10,7 @@
|
|||||||
# remove all packages for amd igpu. I only removed amdgpu from
|
# remove all packages for amd igpu. I only removed amdgpu from
|
||||||
# services.xserver.videoDrivers by overriding. This is because the specialization
|
# services.xserver.videoDrivers by overriding. This is because the specialization
|
||||||
# of nix cannot implement such an operation as canceling an import.
|
# of nix cannot implement such an operation as canceling an import.
|
||||||
hardware =
|
hardware = {
|
||||||
{
|
|
||||||
nvidia.prime.offload.enable = false;
|
nvidia.prime.offload.enable = false;
|
||||||
}
|
}
|
||||||
// lib.optionalAttrs (options ? amdgpu.opencl.enable) {
|
// lib.optionalAttrs (options ? amdgpu.opencl.enable) {
|
||||||
|
|||||||
@@ -3,8 +3,7 @@
|
|||||||
{
|
{
|
||||||
imports = [ ../hybrid ];
|
imports = [ ../hybrid ];
|
||||||
services.xserver.videoDrivers = [ "nvidia" ];
|
services.xserver.videoDrivers = [ "nvidia" ];
|
||||||
hardware =
|
hardware = {
|
||||||
{
|
|
||||||
nvidia.prime.offload.enable = false;
|
nvidia.prime.offload.enable = false;
|
||||||
}
|
}
|
||||||
// lib.optionalAttrs (options ? amdgpu.opencl.enable) {
|
// lib.optionalAttrs (options ? amdgpu.opencl.enable) {
|
||||||
|
|||||||
@@ -32,8 +32,4 @@
|
|||||||
|
|
||||||
# Avoid issues with modesetting causing blank screen
|
# Avoid issues with modesetting causing blank screen
|
||||||
services.xserver.videoDrivers = [ "nvidia" ];
|
services.xserver.videoDrivers = [ "nvidia" ];
|
||||||
|
|
||||||
# AMD has better battery life with PPD over TLP:
|
|
||||||
# https://community.frame.work/t/responded-amd-7040-sleep-states/38101/13
|
|
||||||
services.power-profiles-daemon.enable = lib.mkDefault true;
|
|
||||||
}
|
}
|
||||||
@@ -14,8 +14,9 @@
|
|||||||
|
|
||||||
# amdgpu.backlight=0 makes the backlight work
|
# amdgpu.backlight=0 makes the backlight work
|
||||||
# acpi_backlight=none allows the backlight save/load systemd service to work on older kernel versions
|
# acpi_backlight=none allows the backlight save/load systemd service to work on older kernel versions
|
||||||
boot.kernelParams =
|
boot.kernelParams = [
|
||||||
[ "amdgpu.backlight=0" ]
|
"amdgpu.backlight=0"
|
||||||
|
]
|
||||||
++ lib.optional (lib.versionOlder config.boot.kernelPackages.kernel.version "6.1.6") "acpi_backlight=none";
|
++ lib.optional (lib.versionOlder config.boot.kernelPackages.kernel.version "6.1.6") "acpi_backlight=none";
|
||||||
|
|
||||||
# For mainline support of rtw89 wireless networking
|
# For mainline support of rtw89 wireless networking
|
||||||
|
|||||||
@@ -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.
|
||||||
@@ -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" ];
|
||||||
|
}
|
||||||
@@ -110,9 +110,6 @@ in
|
|||||||
kernelParams = mkDefault [ "mem_sleep_default=deep" ];
|
kernelParams = mkDefault [ "mem_sleep_default=deep" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# NOTE: Check the README before enabling TLP:
|
|
||||||
services.tlp.enable = mkDefault false;
|
|
||||||
|
|
||||||
# Needed for wifi firmware, see https://github.com/NixOS/nixos-hardware/issues/364
|
# Needed for wifi firmware, see https://github.com/NixOS/nixos-hardware/issues/364
|
||||||
hardware = {
|
hardware = {
|
||||||
enableRedistributableFirmware = mkDefault true;
|
enableRedistributableFirmware = mkDefault true;
|
||||||
|
|||||||
@@ -24,8 +24,7 @@ let
|
|||||||
let
|
let
|
||||||
inherit (builtins) removeAttrs;
|
inherit (builtins) removeAttrs;
|
||||||
|
|
||||||
args' =
|
args' = {
|
||||||
{
|
|
||||||
inherit
|
inherit
|
||||||
src
|
src
|
||||||
version
|
version
|
||||||
|
|||||||
@@ -139,7 +139,8 @@
|
|||||||
device = "/iso/nix-store.squashfs";
|
device = "/iso/nix-store.squashfs";
|
||||||
options = [
|
options = [
|
||||||
"loop"
|
"loop"
|
||||||
] ++ lib.optional (config.boot.kernelPackages.kernel.kernelAtLeast "6.2") "threads=multi";
|
]
|
||||||
|
++ lib.optional (config.boot.kernelPackages.kernel.kernelAtLeast "6.2") "threads=multi";
|
||||||
neededForBoot = true;
|
neededForBoot = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{ config, ... }:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
../../common/cpu/amd
|
||||||
|
../../common/pc/ssd
|
||||||
|
../../common/pc
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.extraModulePackages = with config.boot.kernelPackages; [
|
||||||
|
nct6687d
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.kernelModules = [ "nct6687d" ];
|
||||||
|
}
|
||||||
+53
-3
@@ -21,19 +21,69 @@ Code snippet example that enables imx8qm configuration:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2.2 For imx8mq-evk/imx8mp-evk
|
### 2.2 For imx8mq-evk/imx8mp-evk/imx93-evk
|
||||||
This NXP overlay is used for generating sdimage.
|
This NXP overlay is used for generating sdimage.
|
||||||
Current configuration uses uboot as a bootloader. It provides an options to use optee-os which is currently disabled. It can be enabled using `enable-tee` boolean argument avalable in `imx8m<q/p>-boot.nix`, which is `false` by default.
|
Current configuration uses uboot as a bootloader. It provides an options to use optee-os which is currently disabled. It can be enabled using `enable-tee` boolean argument avalable in `imx8m<q/p>-boot.nix`, which is `false` by default in imx8m platform.
|
||||||
|
|
||||||
Code snippet example that enables 'imx8mp-evk/emx8mq-evk' configuration:
|
Code snippet example that enables 'imx8mp-evk/imx8mq-evk/imx93-evk' configuration:
|
||||||
|
|
||||||
```
|
```
|
||||||
{ nixos-hardware, }: {
|
{ nixos-hardware, }: {
|
||||||
system = "aarch64-linux";
|
system = "aarch64-linux";
|
||||||
modules = [
|
modules = [
|
||||||
nixos-hardware.nixosModules.imx8mp-evk #For imx8mp-evk
|
nixos-hardware.nixosModules.imx8mp-evk #For imx8mp-evk
|
||||||
|
#nixos-hardware.nixosModules.imx93-evk #For imx93-evk
|
||||||
#nixos-hardware.nixosModules.imx8mq-evk #For imx8mq-evk
|
#nixos-hardware.nixosModules.imx8mq-evk #For imx8mq-evk
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 2.3 Building Boot Images
|
||||||
|
|
||||||
|
Boot images for flashing to SD cards can be built directly from the flake:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Build boot image for i.MX8MP EVK
|
||||||
|
nix build github:NixOS/nixos-hardware#packages.aarch64-linux.imx8mp-boot
|
||||||
|
|
||||||
|
# Build boot image for i.MX8MQ EVK
|
||||||
|
nix build github:NixOS/nixos-hardware#packages.aarch64-linux.imx8mq-boot
|
||||||
|
|
||||||
|
# Build boot image for i.MX93 EVK
|
||||||
|
nix build github:NixOS/nixos-hardware#packages.aarch64-linux.imx93-boot
|
||||||
|
|
||||||
|
# Or from a local checkout
|
||||||
|
nix build .#packages.aarch64-linux.imx8mp-boot
|
||||||
|
```
|
||||||
|
|
||||||
|
The boot image will be available at `./result/image/flash.bin`.
|
||||||
|
|
||||||
|
**Note:** These packages target `aarch64-linux`. If you're on a different architecture (e.g., x86_64-linux), you'll need remote builders configured for aarch64-linux.
|
||||||
|
|
||||||
|
### 2.4 Flashing to SD Card
|
||||||
|
|
||||||
|
Once built, you can flash the boot image to an SD card:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# For i.MX8MP and i.MX93 (32KB offset):
|
||||||
|
sudo dd if=./result/image/flash.bin of=/dev/sdX bs=1k seek=32 conv=fsync
|
||||||
|
|
||||||
|
# For i.MX8MQ (33KB offset):
|
||||||
|
sudo dd if=./result/image/flash.bin of=/dev/sdX bs=1k seek=33 conv=fsync
|
||||||
|
```
|
||||||
|
|
||||||
|
**Note:** Different i.MX processors require different offsets. i.MX8MP and i.MX93 use 32KB (seek=32), while i.MX8MQ uses 33KB (seek=33).
|
||||||
|
|
||||||
|
**Warning:** Double-check the device path to avoid overwriting the wrong disk!
|
||||||
|
|
||||||
|
## 3. Upstream Documentation
|
||||||
|
|
||||||
|
### U-Boot Board Documentation
|
||||||
|
- [NXP i.MX8MP EVK U-Boot Documentation](https://docs.u-boot.org/en/latest/board/nxp/imx8mp_evk.html)
|
||||||
|
- [NXP i.MX8MQ EVK U-Boot Documentation](https://docs.u-boot.org/en/latest/board/nxp/imx8mq_evk.html)
|
||||||
|
- [NXP i.MX93 11x11 EVK U-Boot Documentation](https://docs.u-boot.org/en/latest/board/nxp/imx93_11x11_evk.html)
|
||||||
|
- [NXP i.MX95 EVK U-Boot Documentation](https://docs.u-boot.org/en/latest/board/nxp/imx95_evk.html)
|
||||||
|
|
||||||
|
### Additional Resources
|
||||||
|
- [NXP i.MX 8M Series TF-A Documentation](https://trustedfirmware-a.readthedocs.io/en/latest/plat/imx8m.html)
|
||||||
|
|
||||||
@@ -47,8 +47,7 @@ pkgs.stdenv.mkDerivation rec {
|
|||||||
${firmwareSeco} --auto-accept --force
|
${firmwareSeco} --auto-accept --force
|
||||||
'';
|
'';
|
||||||
|
|
||||||
filesToInstall =
|
filesToInstall = [
|
||||||
[
|
|
||||||
"firmware-imx-${fwHdmiVersion}/firmware/hdmi/cadence/dpfw.bin"
|
"firmware-imx-${fwHdmiVersion}/firmware/hdmi/cadence/dpfw.bin"
|
||||||
"firmware-imx-${fwHdmiVersion}/firmware/hdmi/cadence/hdmi?xfw.bin"
|
"firmware-imx-${fwHdmiVersion}/firmware/hdmi/cadence/hdmi?xfw.bin"
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
# Parameterized Linux kernel builder for i.MX platforms
|
||||||
|
# This builder is used across i.MX93, i.MX8MP, i.MX8MQ and similar platforms
|
||||||
|
{ lib, pkgs, ... }@args:
|
||||||
|
let
|
||||||
|
inherit (pkgs) buildLinux;
|
||||||
|
|
||||||
|
# Import common kernel configuration
|
||||||
|
kernelConfig = import ../lib/kernel-config.nix;
|
||||||
|
in
|
||||||
|
# Platform-specific parameters
|
||||||
|
{
|
||||||
|
pname,
|
||||||
|
version,
|
||||||
|
src,
|
||||||
|
defconfig ? "imx_v8_defconfig",
|
||||||
|
# Optional parameters
|
||||||
|
extraConfig ? "",
|
||||||
|
kernelPatches ? [ ],
|
||||||
|
autoModules ? false,
|
||||||
|
ignoreConfigErrors ? true,
|
||||||
|
extraMeta ? { },
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
# Combine common i.MX kernel config with platform-specific config
|
||||||
|
finalExtraConfig = kernelConfig.imxCommonKernelConfig + extraConfig;
|
||||||
|
in
|
||||||
|
buildLinux (
|
||||||
|
args
|
||||||
|
// rec {
|
||||||
|
inherit
|
||||||
|
version
|
||||||
|
defconfig
|
||||||
|
kernelPatches
|
||||||
|
autoModules
|
||||||
|
ignoreConfigErrors
|
||||||
|
;
|
||||||
|
name = pname;
|
||||||
|
|
||||||
|
# modDirVersion needs to be x.y.z, will automatically add .0 if needed
|
||||||
|
modDirVersion = version;
|
||||||
|
|
||||||
|
extraConfig = finalExtraConfig;
|
||||||
|
|
||||||
|
inherit src;
|
||||||
|
|
||||||
|
meta =
|
||||||
|
with lib;
|
||||||
|
{
|
||||||
|
homepage = "https://github.com/nxp-imx/linux-imx";
|
||||||
|
license = [ licenses.gpl2Only ];
|
||||||
|
platforms = [ "aarch64-linux" ];
|
||||||
|
}
|
||||||
|
// extraMeta;
|
||||||
|
}
|
||||||
|
// (args.argsOverride or { })
|
||||||
|
)
|
||||||
@@ -16,12 +16,12 @@ pkgs.stdenv.mkDerivation rec {
|
|||||||
--replace 'CC = gcc' 'CC = clang'
|
--replace 'CC = gcc' 'CC = clang'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
nativeBuildInputs = [
|
depsBuildBuild = [
|
||||||
clang
|
pkgs.buildPackages.stdenv.cc
|
||||||
git
|
|
||||||
];
|
];
|
||||||
|
|
||||||
buildInputs = [
|
nativeBuildInputs = [
|
||||||
|
clang
|
||||||
git
|
git
|
||||||
glibc.static
|
glibc.static
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -0,0 +1,89 @@
|
|||||||
|
# Parameterized OP-TEE OS builder for i.MX platforms
|
||||||
|
# This builder is used across i.MX93, i.MX8MP, i.MX8MQ and similar platforms
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
# Platform-specific parameters
|
||||||
|
pname,
|
||||||
|
version,
|
||||||
|
platformFlavor,
|
||||||
|
src,
|
||||||
|
# Optional parameters
|
||||||
|
meta ? { },
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
inherit (pkgs.buildPackages) python3;
|
||||||
|
toolchain = pkgs.stdenv.cc;
|
||||||
|
binutils = pkgs.stdenv.cc.bintools.bintools_bin;
|
||||||
|
cpp = pkgs.stdenv.cc;
|
||||||
|
|
||||||
|
# Determine PLATFORM and PLATFORM_FLAVOR from platformFlavor
|
||||||
|
# Format can be either "imx-mx93evk" (full platform string) or "mx8mpevk" (just flavor, platform is "imx")
|
||||||
|
# Check if it starts with "imx-" to determine if it's a full platform string or just a flavor
|
||||||
|
hasFullPlatform = lib.hasPrefix "imx-" platformFlavor;
|
||||||
|
platform = if hasFullPlatform then platformFlavor else "imx";
|
||||||
|
flavor = if hasFullPlatform then null else platformFlavor;
|
||||||
|
in
|
||||||
|
pkgs.stdenv.mkDerivation {
|
||||||
|
inherit pname version src;
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
python3
|
||||||
|
];
|
||||||
|
|
||||||
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
propagatedBuildInputs = with python3.pkgs; [
|
||||||
|
pycryptodomex
|
||||||
|
pyelftools
|
||||||
|
cryptography
|
||||||
|
];
|
||||||
|
|
||||||
|
# Common postPatch for all i.MX platforms
|
||||||
|
# This is the major source of code duplication - ~60 lines of identical substitutions
|
||||||
|
postPatch = ''
|
||||||
|
# Patch all script shebangs automatically
|
||||||
|
patchShebangs scripts/
|
||||||
|
patchShebangs ta/
|
||||||
|
|
||||||
|
# Patch toolchain paths in mk/gcc.mk
|
||||||
|
substituteInPlace mk/gcc.mk \
|
||||||
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))objcopy" ${binutils}/bin/${toolchain.targetPrefix}objcopy
|
||||||
|
substituteInPlace mk/gcc.mk \
|
||||||
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))objdump" ${binutils}/bin/${toolchain.targetPrefix}objdump
|
||||||
|
substituteInPlace mk/gcc.mk \
|
||||||
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))nm" ${binutils}/bin/${toolchain.targetPrefix}nm
|
||||||
|
substituteInPlace mk/gcc.mk \
|
||||||
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))readelf" ${binutils}/bin/${toolchain.targetPrefix}readelf
|
||||||
|
substituteInPlace mk/gcc.mk \
|
||||||
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))ar" ${binutils}/bin/${toolchain.targetPrefix}ar
|
||||||
|
substituteInPlace mk/gcc.mk \
|
||||||
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))cpp" ${cpp}/bin/${toolchain.targetPrefix}cpp
|
||||||
|
'';
|
||||||
|
|
||||||
|
makeFlags = [
|
||||||
|
"PLATFORM=${platform}"
|
||||||
|
]
|
||||||
|
++ lib.optionals (!hasFullPlatform) [
|
||||||
|
"PLATFORM_FLAVOR=${flavor}"
|
||||||
|
]
|
||||||
|
++ [
|
||||||
|
"CFG_ARM64_core=y"
|
||||||
|
"CFG_TEE_TA_LOG_LEVEL=0"
|
||||||
|
"CFG_TEE_CORE_LOG_LEVEL=0"
|
||||||
|
"CROSS_COMPILE=${toolchain}/bin/${toolchain.targetPrefix}"
|
||||||
|
"CROSS_COMPILE64=${toolchain}/bin/${toolchain.targetPrefix}"
|
||||||
|
];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out
|
||||||
|
cp ./out/arm-plat-imx/core/tee-raw.bin $out/tee.bin
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
homepage = "https://github.com/nxp-imx/imx-optee-os";
|
||||||
|
license = [ lib.licenses.bsd2 ];
|
||||||
|
platforms = [ "aarch64-linux" ];
|
||||||
|
}
|
||||||
|
// meta;
|
||||||
|
}
|
||||||
@@ -17,7 +17,7 @@ let
|
|||||||
cpp = pkgs.buildPackages.gcc;
|
cpp = pkgs.buildPackages.gcc;
|
||||||
|
|
||||||
in
|
in
|
||||||
pkgs.stdenv.mkDerivation rec {
|
pkgs.stdenv.mkDerivation {
|
||||||
|
|
||||||
pname = "imx-optee-os";
|
pname = "imx-optee-os";
|
||||||
version = "5.15.32_2.0.0";
|
version = "5.15.32_2.0.0";
|
||||||
@@ -41,25 +41,25 @@ pkgs.stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
substituteInPlace scripts/arm32_sysreg.py \
|
substituteInPlace scripts/arm32_sysreg.py \
|
||||||
--replace '/usr/bin/env python3' '${python3}/bin/python'
|
--replace-fail '/usr/bin/env python3' '${python3}/bin/python'
|
||||||
substituteInPlace scripts/gen_tee_bin.py \
|
substituteInPlace scripts/gen_tee_bin.py \
|
||||||
--replace '/usr/bin/env python3' '${python3}/bin/python'
|
--replace-fail '/usr/bin/env python3' '${python3}/bin/python'
|
||||||
substituteInPlace scripts/pem_to_pub_c.py \
|
substituteInPlace scripts/pem_to_pub_c.py \
|
||||||
--replace '/usr/bin/env python3' '${python3}/bin/python'
|
--replace-fail '/usr/bin/env python3' '${python3}/bin/python'
|
||||||
substituteInPlace ta/pkcs11/scripts/verify-helpers.sh \
|
substituteInPlace ta/pkcs11/scripts/verify-helpers.sh \
|
||||||
--replace '/bin/bash' '${pkgs.bash}/bin/bash'
|
--replace-fail '/bin/bash' '${pkgs.bash}/bin/bash'
|
||||||
substituteInPlace mk/gcc.mk \
|
substituteInPlace mk/gcc.mk \
|
||||||
--replace "\$(CROSS_COMPILE_\$(sm))objcopy" ${binutils}/bin/${toolchain.targetPrefix}objcopy
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))objcopy" ${binutils}/bin/${toolchain.targetPrefix}objcopy
|
||||||
substituteInPlace mk/gcc.mk \
|
substituteInPlace mk/gcc.mk \
|
||||||
--replace "\$(CROSS_COMPILE_\$(sm))objdump" ${binutils}/bin/${toolchain.targetPrefix}objdump
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))objdump" ${binutils}/bin/${toolchain.targetPrefix}objdump
|
||||||
substituteInPlace mk/gcc.mk \
|
substituteInPlace mk/gcc.mk \
|
||||||
--replace "\$(CROSS_COMPILE_\$(sm))nm" ${binutils}/bin/${toolchain.targetPrefix}nm
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))nm" ${binutils}/bin/${toolchain.targetPrefix}nm
|
||||||
substituteInPlace mk/gcc.mk \
|
substituteInPlace mk/gcc.mk \
|
||||||
--replace "\$(CROSS_COMPILE_\$(sm))readelf" ${binutils}/bin/${toolchain.targetPrefix}readelf
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))readelf" ${binutils}/bin/${toolchain.targetPrefix}readelf
|
||||||
substituteInPlace mk/gcc.mk \
|
substituteInPlace mk/gcc.mk \
|
||||||
--replace "\$(CROSS_COMPILE_\$(sm))ar" ${binutils}/bin/${toolchain.targetPrefix}ar
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))ar" ${binutils}/bin/${toolchain.targetPrefix}ar
|
||||||
substituteInPlace mk/gcc.mk \
|
substituteInPlace mk/gcc.mk \
|
||||||
--replace "\$(CROSS_COMPILE_\$(sm))cpp" ${cpp}/bin/cpp
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))cpp" "${cpp}/bin/${toolchain.targetPrefix}cpp"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
makeFlags = [
|
makeFlags = [
|
||||||
|
|||||||
@@ -0,0 +1,98 @@
|
|||||||
|
# Parameterized U-Boot builder for i.MX platforms
|
||||||
|
# This builder is used across i.MX93, i.MX8MP, i.MX8MQ and similar platforms
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
stdenv,
|
||||||
|
buildPackages,
|
||||||
|
# Required dependencies
|
||||||
|
bison,
|
||||||
|
dtc,
|
||||||
|
flex,
|
||||||
|
gnutls,
|
||||||
|
libuuid,
|
||||||
|
ncurses,
|
||||||
|
openssl,
|
||||||
|
perl,
|
||||||
|
efitools,
|
||||||
|
which,
|
||||||
|
# Platform-specific parameters
|
||||||
|
pname,
|
||||||
|
version,
|
||||||
|
src,
|
||||||
|
defconfig,
|
||||||
|
ramdiskAddr,
|
||||||
|
fdtAddr,
|
||||||
|
dtbPath,
|
||||||
|
# Optional parameters
|
||||||
|
extraConfig ? "",
|
||||||
|
extraNativeBuildInputs ? [ ],
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
# Import common U-Boot configuration
|
||||||
|
ubootConfig = import ../lib/uboot-config.nix;
|
||||||
|
|
||||||
|
# Generate the common config with platform-specific memory addresses
|
||||||
|
commonConfig = ubootConfig.imxCommonUbootConfig {
|
||||||
|
inherit ramdiskAddr fdtAddr;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Combine common config with any platform-specific extra config
|
||||||
|
finalExtraConfig = commonConfig + extraConfig;
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
inherit pname version src;
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
patchShebangs tools
|
||||||
|
patchShebangs scripts
|
||||||
|
'';
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
bison
|
||||||
|
flex
|
||||||
|
openssl
|
||||||
|
which
|
||||||
|
ncurses
|
||||||
|
libuuid
|
||||||
|
gnutls
|
||||||
|
perl
|
||||||
|
efitools
|
||||||
|
]
|
||||||
|
++ extraNativeBuildInputs;
|
||||||
|
|
||||||
|
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
||||||
|
hardeningDisable = [ "all" ];
|
||||||
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
makeFlags = [
|
||||||
|
"DTC=${lib.getExe buildPackages.dtc}"
|
||||||
|
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
|
||||||
|
];
|
||||||
|
|
||||||
|
extraConfig = finalExtraConfig;
|
||||||
|
|
||||||
|
passAsFile = [ "extraConfig" ];
|
||||||
|
|
||||||
|
configurePhase = ''
|
||||||
|
runHook preConfigure
|
||||||
|
|
||||||
|
make ${defconfig}
|
||||||
|
cat $extraConfigPath >> .config
|
||||||
|
|
||||||
|
runHook postConfigure
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
mkdir -p $out
|
||||||
|
cp ./u-boot-nodtb.bin $out
|
||||||
|
cp ./spl/u-boot-spl.bin $out
|
||||||
|
cp ${dtbPath} $out
|
||||||
|
cp .config $out
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
|
dontStrip = true;
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
# Shared kernel configuration for i.MX platforms
|
||||||
|
# This configuration is used across i.MX93, i.MX8MP, i.MX8MQ and similar platforms
|
||||||
|
{
|
||||||
|
# Common kernel extra configuration for i.MX platforms
|
||||||
|
# Includes: virtualization support, EFI boot, RAID, USB/IP, framebuffer settings
|
||||||
|
imxCommonKernelConfig = ''
|
||||||
|
CRYPTO_TLS m
|
||||||
|
TLS y
|
||||||
|
MD_RAID0 m
|
||||||
|
MD_RAID1 m
|
||||||
|
MD_RAID10 m
|
||||||
|
MD_RAID456 m
|
||||||
|
DM_VERITY m
|
||||||
|
LOGO y
|
||||||
|
FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER n
|
||||||
|
FB_EFI n
|
||||||
|
EFI_STUB y
|
||||||
|
EFI y
|
||||||
|
VIRTIO y
|
||||||
|
VIRTIO_PCI y
|
||||||
|
VIRTIO_BLK y
|
||||||
|
DRM_VIRTIO_GPU y
|
||||||
|
EXT4_FS y
|
||||||
|
USBIP_CORE m
|
||||||
|
USBIP_VHCI_HCD m
|
||||||
|
USBIP_HOST m
|
||||||
|
USBIP_VUDC m
|
||||||
|
'';
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
# Shared U-Boot configuration for i.MX platforms
|
||||||
|
# This configuration is used across i.MX93, i.MX8MP, i.MX8MQ and similar platforms
|
||||||
|
{
|
||||||
|
# Generate common U-Boot extra configuration for i.MX platforms
|
||||||
|
# ramdiskAddr and fdtAddr are platform-specific memory addresses
|
||||||
|
imxCommonUbootConfig =
|
||||||
|
{ ramdiskAddr, fdtAddr }:
|
||||||
|
''
|
||||||
|
CONFIG_USE_BOOTCOMMAND=y
|
||||||
|
CONFIG_BOOTCOMMAND="setenv ramdisk_addr_r ${ramdiskAddr}; setenv fdt_addr_r ${fdtAddr}; run distro_bootcmd; "
|
||||||
|
CONFIG_CMD_BOOTEFI_SELFTEST=y
|
||||||
|
CONFIG_CMD_BOOTEFI=y
|
||||||
|
CONFIG_EFI_LOADER=y
|
||||||
|
CONFIG_BLK=y
|
||||||
|
CONFIG_PARTITIONS=y
|
||||||
|
CONFIG_DM_DEVICE_REMOVE=n
|
||||||
|
CONFIG_CMD_CACHE=y
|
||||||
|
'';
|
||||||
|
|
||||||
|
# Common U-Boot native build inputs for i.MX platforms
|
||||||
|
imxCommonUbootNativeBuildInputs = [
|
||||||
|
"bison"
|
||||||
|
"flex"
|
||||||
|
"openssl"
|
||||||
|
"which"
|
||||||
|
"ncurses"
|
||||||
|
"libuuid"
|
||||||
|
"gnutls"
|
||||||
|
"openssl"
|
||||||
|
"perl"
|
||||||
|
"efitools"
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{ pkgs, lib, ... }:
|
{ pkgs, lib, ... }:
|
||||||
{
|
{
|
||||||
nixpkgs.hostPlatform = "aarch64-linux";
|
nixpkgs.hostPlatform.system = "aarch64-linux";
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./bsp/linux-imx8.nix { });
|
kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./bsp/linux-imx8.nix { });
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
enable-tee ? true,
|
enable-tee ? true,
|
||||||
}:
|
}:
|
||||||
with pkgs;
|
|
||||||
let
|
let
|
||||||
fw-ver = "202006";
|
fw-ver = "202006";
|
||||||
cp-tee = if enable-tee then "install -m 0644 ${imx8mp-optee-os}/tee.bin ./iMX8M/tee.bin" else "";
|
cp-tee = if enable-tee then "install -m 0644 ${imx8mp-optee-os}/tee.bin ./iMX8M/tee.bin" else "";
|
||||||
@@ -22,7 +21,7 @@ let
|
|||||||
shortRev = builtins.substring 0 8 src.rev;
|
shortRev = builtins.substring 0 8 src.rev;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imx8m-boot = pkgs.stdenv.mkDerivation rec {
|
imx8m-boot = pkgs.buildPackages.stdenv.mkDerivation {
|
||||||
inherit src;
|
inherit src;
|
||||||
name = "imx8mp-mkimage";
|
name = "imx8mp-mkimage";
|
||||||
version = "lf-6.1.55-2.2.0";
|
version = "lf-6.1.55-2.2.0";
|
||||||
@@ -30,22 +29,16 @@ in
|
|||||||
postPatch = ''
|
postPatch = ''
|
||||||
substituteInPlace Makefile \
|
substituteInPlace Makefile \
|
||||||
--replace 'git rev-parse --short=8 HEAD' 'echo ${shortRev}'
|
--replace 'git rev-parse --short=8 HEAD' 'echo ${shortRev}'
|
||||||
substituteInPlace Makefile \
|
|
||||||
--replace 'CC = gcc' 'CC = clang'
|
|
||||||
patchShebangs scripts
|
patchShebangs scripts
|
||||||
'';
|
'';
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
clang
|
pkgs.buildPackages.stdenv.cc
|
||||||
git
|
pkgs.buildPackages.git
|
||||||
dtc
|
pkgs.buildPackages.dtc
|
||||||
];
|
pkgs.buildPackages.glibc.static
|
||||||
|
pkgs.buildPackages.zlib
|
||||||
buildInputs = [
|
pkgs.buildPackages.zlib.static
|
||||||
git
|
|
||||||
glibc.static
|
|
||||||
zlib
|
|
||||||
zlib.static
|
|
||||||
];
|
];
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
@@ -54,7 +47,7 @@ in
|
|||||||
make bin
|
make bin
|
||||||
make SOC=iMX8MP mkimage_imx8
|
make SOC=iMX8MP mkimage_imx8
|
||||||
|
|
||||||
cp -v ${pkgs.ubootTools}/bin/mkimage ./iMX8M/mkimage_uboot
|
cp -v ${pkgs.buildPackages.ubootTools}/bin/mkimage ./iMX8M/mkimage_uboot
|
||||||
|
|
||||||
install -m 0644 ${imx8mp-uboot}/u-boot-spl.bin ./iMX8M/u-boot-spl.bin
|
install -m 0644 ${imx8mp-uboot}/u-boot-spl.bin ./iMX8M/u-boot-spl.bin
|
||||||
install -m 0644 ${imx8mp-uboot}/u-boot-nodtb.bin ./iMX8M/u-boot-nodtb.bin
|
install -m 0644 ${imx8mp-uboot}/u-boot-nodtb.bin ./iMX8M/u-boot-nodtb.bin
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
|
|||||||
dontStrip = true;
|
dontStrip = true;
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
${pkgs.bash}/bin/bash $src --auto-accept --force
|
${pkgs.buildPackages.bash}/bin/bash $src --auto-accept --force
|
||||||
mv firmware-imx-${version} $out
|
mv firmware-imx-${version} $out
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
@@ -1,56 +1,20 @@
|
|||||||
{ pkgs, ... }@args:
|
{ pkgs, ... }@args:
|
||||||
with pkgs;
|
(pkgs.callPackage ../../common/bsp/imx-linux-builder.nix args) {
|
||||||
buildLinux (
|
pname = "imx8mp-linux";
|
||||||
args
|
|
||||||
// rec {
|
|
||||||
version = "6.12.20";
|
version = "6.12.20";
|
||||||
name = "imx8mp-linux";
|
|
||||||
|
|
||||||
# modDirVersion needs to be x.y.z, will automatically add .0 if needed
|
src = pkgs.fetchFromGitHub {
|
||||||
modDirVersion = version;
|
|
||||||
|
|
||||||
defconfig = "imx_v8_defconfig";
|
|
||||||
|
|
||||||
# https://github.com/NixOS/nixpkgs/pull/366004
|
|
||||||
# introduced a breaking change that if a module is declared but it is not being used it will faill.
|
|
||||||
ignoreConfigErrors = true;
|
|
||||||
|
|
||||||
kernelPatches = [
|
|
||||||
];
|
|
||||||
|
|
||||||
autoModules = false;
|
|
||||||
|
|
||||||
extraConfig = ''
|
|
||||||
CRYPTO_TLS m
|
|
||||||
TLS y
|
|
||||||
MD_RAID0 m
|
|
||||||
MD_RAID1 m
|
|
||||||
MD_RAID10 m
|
|
||||||
MD_RAID456 m
|
|
||||||
DM_VERITY m
|
|
||||||
LOGO y
|
|
||||||
FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER n
|
|
||||||
FB_EFI n
|
|
||||||
EFI_STUB y
|
|
||||||
EFI y
|
|
||||||
VIRTIO y
|
|
||||||
VIRTIO_PCI y
|
|
||||||
VIRTIO_BLK y
|
|
||||||
DRM_VIRTIO_GPU y
|
|
||||||
EXT4_FS y
|
|
||||||
USBIP_CORE m
|
|
||||||
USBIP_VHCI_HCD m
|
|
||||||
USBIP_HOST m
|
|
||||||
USBIP_VUDC m
|
|
||||||
'';
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "nxp-imx";
|
owner = "nxp-imx";
|
||||||
repo = "linux-imx";
|
repo = "linux-imx";
|
||||||
# tag: lf-6.12.20-2.0.0
|
# tag: lf-6.12.20-2.0.0
|
||||||
rev = "dfaf2136deb2af2e60b994421281ba42f1c087e0";
|
rev = "dfaf2136deb2af2e60b994421281ba42f1c087e0";
|
||||||
sha256 = "sha256-ITrmj3a5YfXh/PSRTi+Rlto5uEBIAWFWtkTsO1ATXIo=";
|
sha256 = "sha256-ITrmj3a5YfXh/PSRTi+Rlto5uEBIAWFWtkTsO1ATXIo=";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Platform-specific configuration (if any)
|
||||||
|
extraConfig = "";
|
||||||
|
|
||||||
|
# https://github.com/NixOS/nixpkgs/pull/366004
|
||||||
|
# introduced a breaking change that if a module is declared but it is not being used it will faill.
|
||||||
|
ignoreConfigErrors = true;
|
||||||
}
|
}
|
||||||
// (args.argsOverride or { })
|
|
||||||
)
|
|
||||||
@@ -1,69 +1,13 @@
|
|||||||
{ pkgs }:
|
{ pkgs }:
|
||||||
let
|
pkgs.callPackage ../../common/bsp/imx-optee-builder.nix {
|
||||||
inherit (pkgs.buildPackages) python3;
|
|
||||||
toolchain = pkgs.gccStdenv.cc;
|
|
||||||
binutils = pkgs.gccStdenv.cc.bintools.bintools_bin;
|
|
||||||
cpp = pkgs.gcc;
|
|
||||||
in
|
|
||||||
pkgs.stdenv.mkDerivation rec {
|
|
||||||
pname = "imx8mp-optee-os";
|
pname = "imx8mp-optee-os";
|
||||||
version = "lf-6.12.20-2.0.0";
|
version = "lf-6.12.20-2.0.0";
|
||||||
|
|
||||||
nativeBuildInputs = [
|
|
||||||
python3
|
|
||||||
];
|
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
|
||||||
|
|
||||||
propagatedBuildInputs = with python3.pkgs; [
|
|
||||||
pycryptodomex
|
|
||||||
pyelftools
|
|
||||||
cryptography
|
|
||||||
];
|
|
||||||
|
|
||||||
src = pkgs.fetchgit {
|
src = pkgs.fetchgit {
|
||||||
url = "https://github.com/nxp-imx/imx-optee-os.git";
|
url = "https://github.com/nxp-imx/imx-optee-os.git";
|
||||||
rev = "87964807d80baf1dcfd89cafc66de34a1cf16bf3";
|
rev = "87964807d80baf1dcfd89cafc66de34a1cf16bf3";
|
||||||
sha256 = "sha256-AMZUMgmmyi5l3BMT84uubwjU0lwNObs9XW6ZCbqfhmc=";
|
sha256 = "sha256-AMZUMgmmyi5l3BMT84uubwjU0lwNObs9XW6ZCbqfhmc=";
|
||||||
};
|
};
|
||||||
|
|
||||||
postPatch = ''
|
platformFlavor = "mx8mpevk";
|
||||||
substituteInPlace scripts/arm32_sysreg.py \
|
|
||||||
--replace '/usr/bin/env python3' '${python3}/bin/python'
|
|
||||||
substituteInPlace scripts/gen_tee_bin.py \
|
|
||||||
--replace '/usr/bin/env python3' '${python3}/bin/python'
|
|
||||||
substituteInPlace scripts/pem_to_pub_c.py \
|
|
||||||
--replace '/usr/bin/env python3' '${python3}/bin/python'
|
|
||||||
substituteInPlace ta/pkcs11/scripts/verify-helpers.sh \
|
|
||||||
--replace '/usr/bin/env bash' '${pkgs.bash}/bin/bash'
|
|
||||||
substituteInPlace ta/pkcs11/scripts/dump_ec_curve_params.sh \
|
|
||||||
--replace '/usr/bin/env bash' '${pkgs.bash}/bin/bash'
|
|
||||||
substituteInPlace mk/gcc.mk \
|
|
||||||
--replace "\$(CROSS_COMPILE_\$(sm))objcopy" ${binutils}/bin/${toolchain.targetPrefix}objcopy
|
|
||||||
substituteInPlace mk/gcc.mk \
|
|
||||||
--replace "\$(CROSS_COMPILE_\$(sm))objdump" ${binutils}/bin/${toolchain.targetPrefix}objdump
|
|
||||||
substituteInPlace mk/gcc.mk \
|
|
||||||
--replace "\$(CROSS_COMPILE_\$(sm))nm" ${binutils}/bin/${toolchain.targetPrefix}nm
|
|
||||||
substituteInPlace mk/gcc.mk \
|
|
||||||
--replace "\$(CROSS_COMPILE_\$(sm))readelf" ${binutils}/bin/${toolchain.targetPrefix}readelf
|
|
||||||
substituteInPlace mk/gcc.mk \
|
|
||||||
--replace "\$(CROSS_COMPILE_\$(sm))ar" ${binutils}/bin/${toolchain.targetPrefix}ar
|
|
||||||
substituteInPlace mk/gcc.mk \
|
|
||||||
--replace "\$(CROSS_COMPILE_\$(sm))cpp" ${cpp}/bin/cpp
|
|
||||||
'';
|
|
||||||
|
|
||||||
makeFlags = [
|
|
||||||
"PLATFORM=imx"
|
|
||||||
"PLATFORM_FLAVOR=mx8mpevk"
|
|
||||||
"CFG_ARM64_core=y"
|
|
||||||
"CFG_TEE_TA_LOG_LEVEL=0"
|
|
||||||
"CFG_TEE_CORE_LOG_LEVEL=0"
|
|
||||||
"CROSS_COMPILE=${toolchain}/bin/${toolchain.targetPrefix}"
|
|
||||||
"CROSS_COMPILE64=${toolchain}/bin/${toolchain.targetPrefix}"
|
|
||||||
];
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out
|
|
||||||
cp ./out/arm-plat-imx/core/tee-raw.bin $out/tee.bin
|
|
||||||
'';
|
|
||||||
}
|
}
|
||||||
@@ -1,93 +1,17 @@
|
|||||||
{
|
{ pkgs, fetchgit }:
|
||||||
stdenv,
|
pkgs.callPackage ../../common/bsp/imx-uboot-builder.nix {
|
||||||
lib,
|
pname = "imx8mp-uboot";
|
||||||
bison,
|
version = "2025.04";
|
||||||
dtc,
|
|
||||||
fetchgit,
|
src = fetchgit {
|
||||||
flex,
|
|
||||||
gnutls,
|
|
||||||
libuuid,
|
|
||||||
ncurses,
|
|
||||||
openssl,
|
|
||||||
which,
|
|
||||||
perl,
|
|
||||||
buildPackages,
|
|
||||||
efitools,
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
ubsrc = fetchgit {
|
|
||||||
url = "https://github.com/nxp-imx/uboot-imx.git";
|
url = "https://github.com/nxp-imx/uboot-imx.git";
|
||||||
# tag: lf-6.12.20-2.0.0
|
# tag: lf-6.12.20-2.0.0
|
||||||
rev = "9383f8387dc76524524da69992db96c22195a57c";
|
rev = "9383f8387dc76524524da69992db96c22195a57c";
|
||||||
sha256 = "sha256-httRSwN8NiKOdL7fZEvN/4AbypGQfegYtJgxKIea+Zg=";
|
sha256 = "sha256-httRSwN8NiKOdL7fZEvN/4AbypGQfegYtJgxKIea+Zg=";
|
||||||
};
|
};
|
||||||
in
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
pname = "imx8mp-uboot";
|
|
||||||
version = "2025.04";
|
|
||||||
src = ubsrc;
|
|
||||||
|
|
||||||
postPatch = ''
|
defconfig = "imx8mp_evk_defconfig";
|
||||||
patchShebangs tools
|
ramdiskAddr = "0x45000000";
|
||||||
patchShebangs scripts
|
fdtAddr = "0x44000000";
|
||||||
'';
|
dtbPath = "./dts/upstream/src/arm64/freescale/imx8mp-evk.dtb";
|
||||||
|
|
||||||
nativeBuildInputs = [
|
|
||||||
bison
|
|
||||||
flex
|
|
||||||
openssl
|
|
||||||
which
|
|
||||||
ncurses
|
|
||||||
libuuid
|
|
||||||
gnutls
|
|
||||||
openssl
|
|
||||||
perl
|
|
||||||
efitools
|
|
||||||
];
|
|
||||||
|
|
||||||
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
|
||||||
hardeningDisable = [ "all" ];
|
|
||||||
enableParallelBuilding = true;
|
|
||||||
|
|
||||||
makeFlags = [
|
|
||||||
"DTC=${lib.getExe buildPackages.dtc}"
|
|
||||||
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
|
|
||||||
];
|
|
||||||
|
|
||||||
extraConfig = ''
|
|
||||||
CONFIG_USE_BOOTCOMMAND=y
|
|
||||||
CONFIG_BOOTCOMMAND="setenv ramdisk_addr_r 0x45000000; setenv fdt_addr_r 0x44000000; run distro_bootcmd; "
|
|
||||||
CONFIG_CMD_BOOTEFI_SELFTEST=y
|
|
||||||
CONFIG_CMD_BOOTEFI=y
|
|
||||||
CONFIG_EFI_LOADER=y
|
|
||||||
CONFIG_BLK=y
|
|
||||||
CONFIG_PARTITIONS=y
|
|
||||||
CONFIG_DM_DEVICE_REMOVE=n
|
|
||||||
CONFIG_CMD_CACHE=y
|
|
||||||
'';
|
|
||||||
|
|
||||||
passAsFile = [ "extraConfig" ];
|
|
||||||
|
|
||||||
configurePhase = ''
|
|
||||||
runHook preConfigure
|
|
||||||
|
|
||||||
make imx8mp_evk_defconfig
|
|
||||||
cat $extraConfigPath >> .config
|
|
||||||
|
|
||||||
runHook postConfigure
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
runHook preInstall
|
|
||||||
|
|
||||||
mkdir -p $out
|
|
||||||
cp ./u-boot-nodtb.bin $out
|
|
||||||
cp ./spl/u-boot-spl.bin $out
|
|
||||||
cp ./dts/upstream/src/arm64/freescale/imx8mp-evk.dtb $out
|
|
||||||
cp .config $out
|
|
||||||
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
|
||||||
|
|
||||||
dontStrip = true;
|
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
nixpkgs.hostPlatform = "aarch64-linux";
|
nixpkgs.hostPlatform.system = "aarch64-linux";
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./bsp/imx8mp-linux.nix { });
|
kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./bsp/imx8mp-linux.nix { });
|
||||||
|
|||||||
@@ -1,56 +1,20 @@
|
|||||||
{ pkgs, ... }@args:
|
{ pkgs, ... }@args:
|
||||||
with pkgs;
|
(pkgs.callPackage ../../common/bsp/imx-linux-builder.nix args) {
|
||||||
buildLinux (
|
pname = "imx8mq-linux";
|
||||||
args
|
|
||||||
// rec {
|
|
||||||
version = "6.1.55";
|
version = "6.1.55";
|
||||||
name = "imx8mq-linux";
|
|
||||||
|
|
||||||
# modDirVersion needs to be x.y.z, will automatically add .0 if needed
|
src = pkgs.fetchFromGitHub {
|
||||||
modDirVersion = version;
|
|
||||||
|
|
||||||
defconfig = "imx_v8_defconfig";
|
|
||||||
|
|
||||||
# https://github.com/NixOS/nixpkgs/pull/366004
|
|
||||||
# introduced a breaking change that if a module is declared but it is not being used it will faill.
|
|
||||||
ignoreConfigErrors = true;
|
|
||||||
|
|
||||||
kernelPatches = [
|
|
||||||
];
|
|
||||||
|
|
||||||
autoModules = false;
|
|
||||||
|
|
||||||
extraConfig = ''
|
|
||||||
CRYPTO_TLS m
|
|
||||||
TLS y
|
|
||||||
MD_RAID0 m
|
|
||||||
MD_RAID1 m
|
|
||||||
MD_RAID10 m
|
|
||||||
MD_RAID456 m
|
|
||||||
DM_VERITY m
|
|
||||||
LOGO y
|
|
||||||
FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER n
|
|
||||||
FB_EFI n
|
|
||||||
EFI_STUB y
|
|
||||||
EFI y
|
|
||||||
VIRTIO y
|
|
||||||
VIRTIO_PCI y
|
|
||||||
VIRTIO_BLK y
|
|
||||||
DRM_VIRTIO_GPU y
|
|
||||||
EXT4_FS y
|
|
||||||
USBIP_CORE m
|
|
||||||
USBIP_VHCI_HCD m
|
|
||||||
USBIP_HOST m
|
|
||||||
USBIP_VUDC m
|
|
||||||
'';
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "nxp-imx";
|
owner = "nxp-imx";
|
||||||
repo = "linux-imx";
|
repo = "linux-imx";
|
||||||
# tag: lf-6.1.55-2.2.0
|
# tag: lf-6.1.55-2.2.0
|
||||||
rev = "770c5fe2c1d1529fae21b7043911cd50c6cf087e";
|
rev = "770c5fe2c1d1529fae21b7043911cd50c6cf087e";
|
||||||
sha256 = "sha256-tIWt75RUrjB6KmUuAYBVyAC1dmVGSUAgqV5ROJh3xU0=";
|
sha256 = "sha256-tIWt75RUrjB6KmUuAYBVyAC1dmVGSUAgqV5ROJh3xU0=";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Platform-specific configuration (if any)
|
||||||
|
extraConfig = "";
|
||||||
|
|
||||||
|
# https://github.com/NixOS/nixpkgs/pull/366004
|
||||||
|
# introduced a breaking change that if a module is declared but it is not being used it will faill.
|
||||||
|
ignoreConfigErrors = true;
|
||||||
}
|
}
|
||||||
// (args.argsOverride or { })
|
|
||||||
)
|
|
||||||
@@ -1,67 +1,13 @@
|
|||||||
{ pkgs }:
|
{ pkgs }:
|
||||||
let
|
pkgs.callPackage ../../common/bsp/imx-optee-builder.nix {
|
||||||
python3 = pkgs.buildPackages.python3;
|
|
||||||
toolchain = pkgs.gcc9Stdenv.cc;
|
|
||||||
binutils = pkgs.gcc9Stdenv.cc.bintools.bintools_bin;
|
|
||||||
cpp = pkgs.gcc;
|
|
||||||
in
|
|
||||||
pkgs.stdenv.mkDerivation rec {
|
|
||||||
pname = "imx8mq-optee-os";
|
pname = "imx8mq-optee-os";
|
||||||
version = "lf-6.1.55-2.2.0";
|
version = "lf-6.1.55-2.2.0";
|
||||||
|
|
||||||
nativeBuildInputs = [
|
|
||||||
python3
|
|
||||||
];
|
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
|
||||||
|
|
||||||
propagatedBuildInputs = with python3.pkgs; [
|
|
||||||
pycryptodomex
|
|
||||||
pyelftools
|
|
||||||
cryptography
|
|
||||||
];
|
|
||||||
|
|
||||||
src = pkgs.fetchgit {
|
src = pkgs.fetchgit {
|
||||||
url = "https://github.com/nxp-imx/imx-optee-os.git";
|
url = "https://github.com/nxp-imx/imx-optee-os.git";
|
||||||
rev = "a303fc80f7c4bd713315687a1fa1d6ed136e78ee";
|
rev = "a303fc80f7c4bd713315687a1fa1d6ed136e78ee";
|
||||||
sha256 = "sha256-OpyG812DX0c06bRZPKWB2cNu6gtZCOvewDhsKgrGB+s=";
|
sha256 = "sha256-OpyG812DX0c06bRZPKWB2cNu6gtZCOvewDhsKgrGB+s=";
|
||||||
};
|
};
|
||||||
|
|
||||||
postPatch = ''
|
platformFlavor = "mx8mqevk";
|
||||||
substituteInPlace scripts/arm32_sysreg.py \
|
|
||||||
--replace '/usr/bin/env python3' '${python3}/bin/python'
|
|
||||||
substituteInPlace scripts/gen_tee_bin.py \
|
|
||||||
--replace '/usr/bin/env python3' '${python3}/bin/python'
|
|
||||||
substituteInPlace scripts/pem_to_pub_c.py \
|
|
||||||
--replace '/usr/bin/env python3' '${python3}/bin/python'
|
|
||||||
substituteInPlace ta/pkcs11/scripts/verify-helpers.sh \
|
|
||||||
--replace '/bin/bash' '${pkgs.bash}/bin/bash'
|
|
||||||
substituteInPlace mk/gcc.mk \
|
|
||||||
--replace "\$(CROSS_COMPILE_\$(sm))objcopy" ${binutils}/bin/${toolchain.targetPrefix}objcopy
|
|
||||||
substituteInPlace mk/gcc.mk \
|
|
||||||
--replace "\$(CROSS_COMPILE_\$(sm))objdump" ${binutils}/bin/${toolchain.targetPrefix}objdump
|
|
||||||
substituteInPlace mk/gcc.mk \
|
|
||||||
--replace "\$(CROSS_COMPILE_\$(sm))nm" ${binutils}/bin/${toolchain.targetPrefix}nm
|
|
||||||
substituteInPlace mk/gcc.mk \
|
|
||||||
--replace "\$(CROSS_COMPILE_\$(sm))readelf" ${binutils}/bin/${toolchain.targetPrefix}readelf
|
|
||||||
substituteInPlace mk/gcc.mk \
|
|
||||||
--replace "\$(CROSS_COMPILE_\$(sm))ar" ${binutils}/bin/${toolchain.targetPrefix}ar
|
|
||||||
substituteInPlace mk/gcc.mk \
|
|
||||||
--replace "\$(CROSS_COMPILE_\$(sm))cpp" ${cpp}/bin/cpp
|
|
||||||
'';
|
|
||||||
|
|
||||||
makeFlags = [
|
|
||||||
"PLATFORM=imx"
|
|
||||||
"PLATFORM_FLAVOR=mx8mqevk"
|
|
||||||
"CFG_ARM64_core=y"
|
|
||||||
"CFG_TEE_TA_LOG_LEVEL=0"
|
|
||||||
"CFG_TEE_CORE_LOG_LEVEL=0"
|
|
||||||
"CROSS_COMPILE=${toolchain}/bin/${toolchain.targetPrefix}"
|
|
||||||
"CROSS_COMPILE64=${toolchain}/bin/${toolchain.targetPrefix}"
|
|
||||||
];
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out
|
|
||||||
cp ./out/arm-plat-imx/core/tee-raw.bin $out/tee.bin
|
|
||||||
'';
|
|
||||||
}
|
}
|
||||||
@@ -1,91 +1,17 @@
|
|||||||
{
|
{ pkgs, fetchgit }:
|
||||||
stdenv,
|
pkgs.callPackage ../../common/bsp/imx-uboot-builder.nix {
|
||||||
lib,
|
pname = "imx8mq-uboot";
|
||||||
bison,
|
version = "2023.04";
|
||||||
dtc,
|
|
||||||
fetchgit,
|
src = fetchgit {
|
||||||
flex,
|
|
||||||
gnutls,
|
|
||||||
libuuid,
|
|
||||||
ncurses,
|
|
||||||
openssl,
|
|
||||||
which,
|
|
||||||
perl,
|
|
||||||
buildPackages,
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
ubsrc = fetchgit {
|
|
||||||
url = "https://github.com/nxp-imx/uboot-imx.git";
|
url = "https://github.com/nxp-imx/uboot-imx.git";
|
||||||
# tag: "lf-6.1.55-2.2.0"
|
# tag: "lf-6.1.55-2.2.0"
|
||||||
rev = "49b102d98881fc28af6e0a8af5ea2186c1d90a5f";
|
rev = "49b102d98881fc28af6e0a8af5ea2186c1d90a5f";
|
||||||
sha256 = "sha256-1j6X82DqezEizeWoSS600XKPNwrQ4yT0vZuUImKAVVA=";
|
sha256 = "sha256-1j6X82DqezEizeWoSS600XKPNwrQ4yT0vZuUImKAVVA=";
|
||||||
};
|
};
|
||||||
in
|
|
||||||
(stdenv.mkDerivation {
|
|
||||||
pname = "imx8mq-uboot";
|
|
||||||
version = "2023.04";
|
|
||||||
src = ubsrc;
|
|
||||||
|
|
||||||
postPatch = ''
|
defconfig = "imx8mq_evk_defconfig";
|
||||||
patchShebangs tools
|
ramdiskAddr = "0x45000000";
|
||||||
patchShebangs scripts
|
fdtAddr = "0x44000000";
|
||||||
'';
|
dtbPath = "./arch/arm/dts/imx8mq-evk.dtb";
|
||||||
|
}
|
||||||
nativeBuildInputs = [
|
|
||||||
bison
|
|
||||||
flex
|
|
||||||
openssl
|
|
||||||
which
|
|
||||||
ncurses
|
|
||||||
libuuid
|
|
||||||
gnutls
|
|
||||||
openssl
|
|
||||||
perl
|
|
||||||
];
|
|
||||||
|
|
||||||
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
|
||||||
hardeningDisable = [ "all" ];
|
|
||||||
enableParallelBuilding = true;
|
|
||||||
|
|
||||||
makeFlags = [
|
|
||||||
"DTC=${lib.getExe buildPackages.dtc}"
|
|
||||||
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
|
|
||||||
];
|
|
||||||
|
|
||||||
extraConfig = ''
|
|
||||||
CONFIG_USE_BOOTCOMMAND=y
|
|
||||||
CONFIG_BOOTCOMMAND="setenv ramdisk_addr_r 0x45000000; setenv fdt_addr_r 0x44000000; run distro_bootcmd; "
|
|
||||||
CONFIG_CMD_BOOTEFI_SELFTEST=y
|
|
||||||
CONFIG_CMD_BOOTEFI=y
|
|
||||||
CONFIG_EFI_LOADER=y
|
|
||||||
CONFIG_BLK=y
|
|
||||||
CONFIG_PARTITIONS=y
|
|
||||||
CONFIG_DM_DEVICE_REMOVE=n
|
|
||||||
CONFIG_CMD_CACHE=y
|
|
||||||
'';
|
|
||||||
|
|
||||||
passAsFile = [ "extraConfig" ];
|
|
||||||
|
|
||||||
configurePhase = ''
|
|
||||||
runHook preConfigure
|
|
||||||
|
|
||||||
make imx8mq_evk_defconfig
|
|
||||||
cat $extraConfigPath >> .config
|
|
||||||
|
|
||||||
runHook postConfigure
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
runHook preInstall
|
|
||||||
|
|
||||||
mkdir -p $out
|
|
||||||
cp ./u-boot-nodtb.bin $out
|
|
||||||
cp ./spl/u-boot-spl.bin $out
|
|
||||||
cp ./arch/arm/dts/imx8mq-evk.dtb $out
|
|
||||||
cp .config $out
|
|
||||||
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
|
||||||
|
|
||||||
dontStrip = true;
|
|
||||||
})
|
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
nixpkgs.hostPlatform = "aarch64-linux";
|
nixpkgs.hostPlatform.system = "aarch64-linux";
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./bsp/imx8mq-linux.nix { });
|
kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./bsp/imx8mq-linux.nix { });
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
fetchgit,
|
||||||
|
stdenv,
|
||||||
|
buildPackages,
|
||||||
|
pkgsCross,
|
||||||
|
openssl,
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
target-board = "imx93";
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "imx93-atf";
|
||||||
|
version = "2.10.0";
|
||||||
|
platform = target-board;
|
||||||
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
src = fetchgit {
|
||||||
|
url = "https://github.com/nxp-imx/imx-atf.git";
|
||||||
|
rev = "28affcae957cb8194917b5246276630f9e6343e1";
|
||||||
|
sha256 = "sha256-a8F+Lf8pwML+tCwawS0N/mrSXWPmFhlUeOg0MCRK3VE=";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Compiler dependencies
|
||||||
|
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
||||||
|
nativeBuildInputs = [ pkgsCross.aarch64-embedded.stdenv.cc ];
|
||||||
|
|
||||||
|
buildInputs = [ openssl ];
|
||||||
|
|
||||||
|
makeFlags = [
|
||||||
|
"HOSTCC=$(CC_FOR_BUILD)"
|
||||||
|
"CROSS_COMPILE=${pkgsCross.aarch64-embedded.stdenv.cc.targetPrefix}"
|
||||||
|
"PLAT=${platform}"
|
||||||
|
"SPD=opteed"
|
||||||
|
"bl31"
|
||||||
|
"LDFLAGS=-no-warn-rwx-segments"
|
||||||
|
];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
mkdir -p $out
|
||||||
|
cp build/${target-board}/release/bl31.bin $out
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
|
hardeningDisable = [ "all" ];
|
||||||
|
dontStrip = true;
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
homepage = "https://github.com/nxp-imx/imx-atf";
|
||||||
|
description = "Reference implementation of secure world software for ARMv8-A";
|
||||||
|
license = [ licenses.bsd3 ];
|
||||||
|
maintainers = with maintainers; [ govindsi ];
|
||||||
|
platforms = [ "aarch64-linux" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
}:
|
||||||
|
with pkgs;
|
||||||
|
let
|
||||||
|
|
||||||
|
imx93-atf = pkgs.callPackage ./imx93-atf.nix { };
|
||||||
|
imx93-firmware = pkgs.callPackage ./imx93-firmware.nix { };
|
||||||
|
imx93-uboot = pkgs.callPackage ./imx93-uboot.nix { };
|
||||||
|
imx93-optee-os = pkgs.callPackage ./imx93-optee-os.nix { };
|
||||||
|
src = pkgs.fetchgit {
|
||||||
|
url = "https://github.com/nxp-imx/imx-mkimage.git";
|
||||||
|
#tag: lf-6.12.3
|
||||||
|
rev = "4622115cbc037f79039c4522faeced4aabea986b";
|
||||||
|
sha256 = "sha256-2gz0GxlB3jwy8PC6+cP3+MpyUzqE1vDTw8nuxK6vo3g=";
|
||||||
|
};
|
||||||
|
shortRev = builtins.substring 0 8 src.rev;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imx93-boot = pkgs.stdenv.mkDerivation rec {
|
||||||
|
inherit src;
|
||||||
|
name = "imx93-mkimage";
|
||||||
|
version = "lf-6.12.3";
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace Makefile \
|
||||||
|
--replace 'git rev-parse --short=8 HEAD' 'echo ${shortRev}'
|
||||||
|
substituteInPlace Makefile \
|
||||||
|
--replace 'CC = gcc' 'CC = clang'
|
||||||
|
substituteInPlace iMX93/soc.mak \
|
||||||
|
--replace 'xxd' "${pkgs.vim.xxd}/bin/xxd"
|
||||||
|
substituteInPlace scripts/fspi_fcb_gen.sh \
|
||||||
|
--replace 'xxd' "${pkgs.vim.xxd}/bin/xxd"
|
||||||
|
substituteInPlace scripts/fspi_packer.sh \
|
||||||
|
--replace 'xxd' "${pkgs.vim.xxd}/bin/xxd"
|
||||||
|
patchShebangs scripts
|
||||||
|
'';
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
clang
|
||||||
|
git
|
||||||
|
dtc
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
git
|
||||||
|
glibc.static
|
||||||
|
zlib
|
||||||
|
zlib.static
|
||||||
|
];
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
runHook preBuild
|
||||||
|
|
||||||
|
make bin
|
||||||
|
# mkimage is common across imx8 and imx9
|
||||||
|
make SOC=iMX8M mkimage_imx8
|
||||||
|
|
||||||
|
if [ -f ${imx93-uboot}/u-boot.bin ]; then
|
||||||
|
install -m 0644 ${imx93-uboot}/u-boot.bin ./iMX93/u-boot.bin
|
||||||
|
else
|
||||||
|
cat ${imx93-uboot}/u-boot-nodtb.bin ${imx93-uboot}/imx93-11x11-evk.dtb > ./iMX93/u-boot.bin
|
||||||
|
fi
|
||||||
|
install -m 0644 ${imx93-uboot}/u-boot-spl.bin ./iMX93/u-boot-spl.bin
|
||||||
|
install -m 0644 ${imx93-uboot}/u-boot-nodtb.bin ./iMX93/u-boot-nodtb.bin
|
||||||
|
install -m 0644 ${imx93-uboot}/imx93-11x11-evk.dtb ./iMX93/imx93-11x11-evk.dtb
|
||||||
|
install -m 0644 ${imx93-optee-os}/tee.bin ./iMX93/tee.bin
|
||||||
|
install -m 0644 ${imx93-atf}/bl31.bin ./iMX93/bl31.bin
|
||||||
|
install -m 0644 ${imx93-firmware}/ddr/lpddr4* ./iMX93/
|
||||||
|
install -m 0644 ${imx93-firmware}/ahab/mx93a1-ahab-container.img ./iMX93/
|
||||||
|
|
||||||
|
make SOC=iMX9 flash_singleboot
|
||||||
|
|
||||||
|
runHook postBuild
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
mkdir -p $out/image
|
||||||
|
install -m 0644 ./iMX93/flash.bin $out/image
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
with pkgs;
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "nxp-firmware";
|
||||||
|
version = "nxp-firmware-8.21-0.11";
|
||||||
|
|
||||||
|
ddrFirmware = fetchurl {
|
||||||
|
url = "https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.21.bin";
|
||||||
|
sha256 = "sha256-w0R/D4E0FczqncLvEggMs6yLvAxnOSp0/H1ZIF61pnI=";
|
||||||
|
};
|
||||||
|
|
||||||
|
ahabFirmware = fetchurl {
|
||||||
|
url = "https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-sentinel-0.11.bin";
|
||||||
|
sha256 = "sha256-JpSAQXqK6apMxBAauUcof8M0VakxAh29xNm621ISvOs=";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
coreutils
|
||||||
|
bash
|
||||||
|
];
|
||||||
|
|
||||||
|
dontUnpack = true;
|
||||||
|
dontStrip = true;
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out
|
||||||
|
|
||||||
|
echo "Extracting DDR firmware..."
|
||||||
|
cp ${ddrFirmware} ./firmware-imx-8.21.bin
|
||||||
|
chmod +x firmware-imx-8.21.bin
|
||||||
|
./firmware-imx-8.21.bin --auto-accept
|
||||||
|
|
||||||
|
echo "Extracting AHAB firmware..."
|
||||||
|
cp ${ahabFirmware} ./firmware-sentinel-0.11.bin
|
||||||
|
chmod +x firmware-sentinel-0.11.bin
|
||||||
|
./firmware-sentinel-0.11.bin --auto-accept
|
||||||
|
|
||||||
|
echo "Copying DDR .bin files..."
|
||||||
|
mkdir -p $out/ddr
|
||||||
|
cp firmware-imx-8.21/firmware/ddr/synopsys/lpddr4*.bin $out/ddr/
|
||||||
|
|
||||||
|
echo "Copying AHAB container image..."
|
||||||
|
mkdir -p $out/ahab
|
||||||
|
cp firmware-sentinel-0.11/mx93a1-ahab-container.img $out/ahab/
|
||||||
|
|
||||||
|
'';
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
{ pkgs, ... }@args:
|
||||||
|
(pkgs.callPackage ../../common/bsp/imx-linux-builder.nix args) {
|
||||||
|
pname = "imx93-linux";
|
||||||
|
version = "6.12.3";
|
||||||
|
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "nxp-imx";
|
||||||
|
repo = "linux-imx";
|
||||||
|
# tag: lf-6.12.3
|
||||||
|
rev = "37d02f4dcbbe6677dc9f5fc17f386c05d6a7bd7a";
|
||||||
|
sha256 = "sha256-1oJMbHR8Ho0zNritEJ+TMOAyYHCW0vwhPkDfLctrZa8=";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Platform-specific configuration (if any)
|
||||||
|
extraConfig = "";
|
||||||
|
|
||||||
|
# https://github.com/NixOS/nixpkgs/pull/366004
|
||||||
|
# introduced a breaking change that if a module is declared but it is not being used it will faill.
|
||||||
|
ignoreConfigErrors = true;
|
||||||
|
|
||||||
|
extraMeta = {
|
||||||
|
maintainers = with pkgs.lib.maintainers; [ govindsi ];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
pkgs.callPackage ../../common/bsp/imx-optee-builder.nix {
|
||||||
|
pname = "imx93-optee-os";
|
||||||
|
version = "lf-6.12.3_1.0.0";
|
||||||
|
|
||||||
|
src = pkgs.fetchgit {
|
||||||
|
url = "https://github.com/nxp-imx/imx-optee-os.git";
|
||||||
|
rev = "8dd180b6d149c1e1314b5869697179f665bd9ca3";
|
||||||
|
sha256 = "sha256-PoolRscdyeGevrOa5YymPTQ36edVvReMM5WshRTz+uk=";
|
||||||
|
};
|
||||||
|
|
||||||
|
platformFlavor = "imx-mx93evk";
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
maintainers = with pkgs.lib.maintainers; [ govindsi ];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
{ pkgs, fetchgit }:
|
||||||
|
pkgs.callPackage ../../common/bsp/imx-uboot-builder.nix {
|
||||||
|
pname = "imx93-uboot";
|
||||||
|
version = "2024.04";
|
||||||
|
|
||||||
|
src = fetchgit {
|
||||||
|
url = "https://github.com/nxp-imx/uboot-imx.git";
|
||||||
|
#lf_v2024.04
|
||||||
|
rev = "e3219a5a73445219df605d1492687918d488055c";
|
||||||
|
sha256 = "sha256-6pXwgNzq4/XUUEmJ6sGC5pII4J5uMvlDPE9QJxjJJbQ=";
|
||||||
|
};
|
||||||
|
|
||||||
|
defconfig = "imx93_11x11_evk_defconfig";
|
||||||
|
ramdiskAddr = "0x85000000";
|
||||||
|
fdtAddr = "0x84000000";
|
||||||
|
dtbPath = "./arch/arm/dts/imx93-11x11-evk.dtb";
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
(import ./overlay.nix)
|
||||||
|
];
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
./modules.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.loader.grub.extraFiles = {
|
||||||
|
"imx93-11x11-evk.dtb" = "${
|
||||||
|
pkgs.callPackage ./bsp/imx93-linux.nix { }
|
||||||
|
}/dtbs/freescale/imx93-11x11-evk.dtb";
|
||||||
|
};
|
||||||
|
|
||||||
|
hardware.deviceTree = {
|
||||||
|
filter = "imx93-*.dtb";
|
||||||
|
name = "imx93-11x11-evk.dtb";
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
nixpkgs.hostPlatform.system = "aarch64-linux";
|
||||||
|
|
||||||
|
boot = {
|
||||||
|
kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./bsp/imx93-linux.nix { });
|
||||||
|
initrd.includeDefaultModules = lib.mkForce false;
|
||||||
|
};
|
||||||
|
|
||||||
|
disabledModules = [ "profiles/all-hardware.nix" ];
|
||||||
|
|
||||||
|
hardware.deviceTree.enable = true;
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
final: _prev: {
|
||||||
|
inherit (final.callPackage ./bsp/imx93-boot.nix { pkgs = final; }) imx93-boot;
|
||||||
|
}
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
|
nixpkgs.hostPlatform.system = lib.mkDefault "aarch64-linux";
|
||||||
|
|
||||||
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
|
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
imports = [
|
||||||
|
../../../common/cpu/intel
|
||||||
|
../../../common/pc/laptop
|
||||||
|
../../../common/pc/ssd
|
||||||
|
];
|
||||||
|
|
||||||
|
# Force use of the intel_backlight driver for backlight control.
|
||||||
|
# This allows the backlight save/load systemd service to work.
|
||||||
|
boot.kernelParams = [ "acpi_backlight=video" ];
|
||||||
|
}
|
||||||
@@ -45,7 +45,8 @@ let
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
{ patch = ./irq-desc-to-data.patch; }
|
{ patch = ./irq-desc-to-data.patch; }
|
||||||
] ++ kernelPatches;
|
]
|
||||||
|
++ kernelPatches;
|
||||||
|
|
||||||
structuredExtraConfig = with lib.kernel; {
|
structuredExtraConfig = with lib.kernel; {
|
||||||
# A ton of stuff just does not build. We disable it all.
|
# A ton of stuff just does not build. We disable it all.
|
||||||
|
|||||||
@@ -5,7 +5,13 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
boot.kernelPackages = lib.mkDefault pkgs.linuxKernel.packages.linux_rpi3;
|
boot = {
|
||||||
|
kernelPackages = lib.mkDefault pkgs.linuxKernel.packages.linux_rpi3;
|
||||||
|
initrd.availableKernelModules = [
|
||||||
|
"usbhid"
|
||||||
|
"usb_storage"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
# fix the following error :
|
# fix the following error :
|
||||||
# modprobe: FATAL: Module ahci not found in directory
|
# modprobe: FATAL: Module ahci not found in directory
|
||||||
|
|||||||
@@ -11,9 +11,7 @@ in
|
|||||||
{
|
{
|
||||||
options.hardware = {
|
options.hardware = {
|
||||||
raspberry-pi."4".audio = {
|
raspberry-pi."4".audio = {
|
||||||
enable = lib.mkEnableOption ''
|
enable = lib.mkEnableOption "configuration for audio";
|
||||||
configuration for audio
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,7 @@ in
|
|||||||
{
|
{
|
||||||
options.hardware = {
|
options.hardware = {
|
||||||
raspberry-pi."4".backlight = {
|
raspberry-pi."4".backlight = {
|
||||||
enable = lib.mkEnableOption ''
|
enable = lib.mkEnableOption "the backlight support for the Raspberry Pi official Touch Display";
|
||||||
Enable the backlight support for the Raspberry Pi official Touch Display
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,7 @@ in
|
|||||||
{
|
{
|
||||||
options.hardware = {
|
options.hardware = {
|
||||||
raspberry-pi."4".bluetooth = {
|
raspberry-pi."4".bluetooth = {
|
||||||
enable = lib.mkEnableOption ''
|
enable = lib.mkEnableOption "configuration for bluetooth";
|
||||||
configuration for bluetooth
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -6,15 +6,13 @@ in
|
|||||||
{
|
{
|
||||||
options.hardware = {
|
options.hardware = {
|
||||||
raspberry-pi."4".digi-amp-plus = {
|
raspberry-pi."4".digi-amp-plus = {
|
||||||
enable = lib.mkEnableOption ''
|
enable = lib.mkEnableOption "support for the IQaudIO DigiAMP+ Hat";
|
||||||
support for the IQaudIO DigiAMP+ Hat.
|
|
||||||
'';
|
|
||||||
|
|
||||||
unmuteAmp = lib.mkOption {
|
unmuteAmp = lib.mkOption {
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
description = ''
|
description = ''
|
||||||
"one-shot" unmute when kernel module first loads.
|
Whether to "one-shot" unmute when kernel module first loads.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,11 @@ in
|
|||||||
{
|
{
|
||||||
options.hardware = {
|
options.hardware = {
|
||||||
raspberry-pi."4".dwc2 = {
|
raspberry-pi."4".dwc2 = {
|
||||||
enable = lib.mkEnableOption ''
|
enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
description = ''
|
||||||
Enable the UDC controller to support USB OTG gadget functions.
|
Enable the UDC controller to support USB OTG gadget functions.
|
||||||
|
|
||||||
In order to verify that this works, connect the Raspberry Pi with
|
In order to verify that this works, connect the Raspberry Pi with
|
||||||
@@ -24,6 +28,7 @@ in
|
|||||||
guides on how to test them, please refer to:
|
guides on how to test them, please refer to:
|
||||||
https://www.kernel.org/doc/Documentation/usb/gadget-testing.txt
|
https://www.kernel.org/doc/Documentation/usb/gadget-testing.txt
|
||||||
'';
|
'';
|
||||||
|
};
|
||||||
dr_mode = lib.mkOption {
|
dr_mode = lib.mkOption {
|
||||||
type = lib.types.enum [
|
type = lib.types.enum [
|
||||||
"host"
|
"host"
|
||||||
|
|||||||
@@ -31,28 +31,32 @@ in
|
|||||||
{
|
{
|
||||||
options.hardware.raspberry-pi."4" = {
|
options.hardware.raspberry-pi."4" = {
|
||||||
i2c0 = {
|
i2c0 = {
|
||||||
enable = lib.mkEnableOption ''
|
enable = lib.mkEnableOption "" // {
|
||||||
|
description = ''
|
||||||
Turn on the VideoCore I2C bus (maps to /dev/i2c-22) and enable access from the i2c group.
|
Turn on the VideoCore I2C bus (maps to /dev/i2c-22) and enable access from the i2c group.
|
||||||
After a reboot, i2c-tools (e.g. i2cdetect -F 22) should work for root or any user in i2c.
|
After a reboot, i2c-tools (e.g. i2cdetect -F 22) should work for root or any user in i2c.
|
||||||
'';
|
'';
|
||||||
|
};
|
||||||
frequency = lib.mkOption {
|
frequency = lib.mkOption {
|
||||||
type = lib.types.nullOr lib.types.int;
|
type = lib.types.nullOr lib.types.int;
|
||||||
default = null;
|
default = null;
|
||||||
description = ''
|
description = ''
|
||||||
interface clock-frequency
|
The interface clock-frequency to configure.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
i2c1 = {
|
i2c1 = {
|
||||||
enable = lib.mkEnableOption ''
|
enable = lib.mkEnableOption "" // {
|
||||||
|
description = ''
|
||||||
Turn on the ARM I2C bus (/dev/i2c-1 on GPIO pins 3 and 5) and enable access from the i2c group.
|
Turn on the ARM I2C bus (/dev/i2c-1 on GPIO pins 3 and 5) and enable access from the i2c group.
|
||||||
After a reboot, i2c-tools (e.g. i2cdetect -F 1) should work for root or any user in i2c.
|
After a reboot, i2c-tools (e.g. i2cdetect -F 1) should work for root or any user in i2c.
|
||||||
'';
|
'';
|
||||||
|
};
|
||||||
frequency = lib.mkOption {
|
frequency = lib.mkOption {
|
||||||
type = lib.types.nullOr lib.types.int;
|
type = lib.types.nullOr lib.types.int;
|
||||||
default = null;
|
default = null;
|
||||||
description = ''
|
description = ''
|
||||||
interface clock-frequency
|
The interface clock-frequency to configure.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -10,12 +10,14 @@ in
|
|||||||
{
|
{
|
||||||
options.hardware = {
|
options.hardware = {
|
||||||
raspberry-pi."4".apply-overlays-dtmerge = {
|
raspberry-pi."4".apply-overlays-dtmerge = {
|
||||||
enable = lib.mkEnableOption ''
|
enable = lib.mkEnableOption "" // {
|
||||||
replace deviceTree.applyOverlays implementation to use dtmerge from libraspberrypi.
|
description = ''
|
||||||
this can resolve issues with applying dtbs for the pi.
|
Whether replace deviceTree.applyOverlays implementation to use dtmerge from libraspberrypi.
|
||||||
|
This can resolve issues with applying dtbs for the pi.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
nixpkgs.overlays = [ dt_ao_overlay ];
|
nixpkgs.overlays = [ dt_ao_overlay ];
|
||||||
|
|||||||
@@ -6,9 +6,7 @@ in
|
|||||||
{
|
{
|
||||||
options.hardware = {
|
options.hardware = {
|
||||||
raspberry-pi."4".poe-hat = {
|
raspberry-pi."4".poe-hat = {
|
||||||
enable = lib.mkEnableOption ''
|
enable = lib.mkEnableOption "support for the Raspberry Pi POE Hat";
|
||||||
support for the Raspberry Pi POE Hat.
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,7 @@ in
|
|||||||
{
|
{
|
||||||
options.hardware = {
|
options.hardware = {
|
||||||
raspberry-pi."4".poe-plus-hat = {
|
raspberry-pi."4".poe-plus-hat = {
|
||||||
enable = lib.mkEnableOption ''
|
enable = lib.mkEnableOption "support for the Raspberry Pi PoE+ HAT";
|
||||||
support for the Raspberry Pi PoE+ HAT.
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,7 @@ in
|
|||||||
{
|
{
|
||||||
options.hardware = {
|
options.hardware = {
|
||||||
raspberry-pi."4".pwm0 = {
|
raspberry-pi."4".pwm0 = {
|
||||||
enable = lib.mkEnableOption ''
|
enable = lib.mkEnableOption "support for the hardware pwm0 channel on GPIO_18";
|
||||||
Enable support for the hardware pwm0 channel on GPIO_18
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -6,13 +6,15 @@ in
|
|||||||
{
|
{
|
||||||
options.hardware = {
|
options.hardware = {
|
||||||
raspberry-pi."4".tc358743 = {
|
raspberry-pi."4".tc358743 = {
|
||||||
enable = lib.mkEnableOption ''
|
enable = lib.mkEnableOption "" // {
|
||||||
|
description = ''
|
||||||
Enable support for the Toshiba TC358743 HDMI-to-CSI-2 converter.
|
Enable support for the Toshiba TC358743 HDMI-to-CSI-2 converter.
|
||||||
|
|
||||||
This can be tested with a plugged in converter device and for example
|
This can be tested with a plugged in converter device and for example
|
||||||
running ustreamer (which starts webservice providing a camera stream):
|
running ustreamer (which starts webservice providing a camera stream):
|
||||||
''${pkgs.ustreamer}/bin/ustreamer --persistent --dv-timings
|
''${pkgs.ustreamer}/bin/ustreamer --persistent --dv-timings
|
||||||
'';
|
'';
|
||||||
|
};
|
||||||
lanes = lib.mkOption {
|
lanes = lib.mkOption {
|
||||||
type = lib.types.enum [
|
type = lib.types.enum [
|
||||||
2
|
2
|
||||||
@@ -23,13 +25,15 @@ in
|
|||||||
Number of CSI lanes available
|
Number of CSI lanes available
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
media-controller = lib.mkEnableOption ''
|
media-controller = lib.mkEnableOption "" // {
|
||||||
|
description = ''
|
||||||
Enable support for the Media Controller API.
|
Enable support for the Media Controller API.
|
||||||
|
|
||||||
See https://forums.raspberrypi.com/viewtopic.php?t=322076 for details
|
See https://forums.raspberrypi.com/viewtopic.php?t=322076 for details
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
hardware.deviceTree.filter = "bcm2711-rpi-4*.dtb";
|
hardware.deviceTree.filter = "bcm2711-rpi-4*.dtb";
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ in
|
|||||||
{
|
{
|
||||||
options.hardware = {
|
options.hardware = {
|
||||||
raspberry-pi."4".touch-ft5406 = {
|
raspberry-pi."4".touch-ft5406 = {
|
||||||
enable = lib.mkEnableOption ''
|
enable = lib.mkEnableOption "" // {
|
||||||
|
description = ''
|
||||||
Enable the touch controller of the official Raspberry Pi touch diplay.
|
Enable the touch controller of the official Raspberry Pi touch diplay.
|
||||||
|
|
||||||
The overlay is taken from the official Raspberry Pi Linux fork, and
|
The overlay is taken from the official Raspberry Pi Linux fork, and
|
||||||
@@ -18,6 +19,7 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
hardware.deviceTree = {
|
hardware.deviceTree = {
|
||||||
|
|||||||
@@ -6,9 +6,7 @@ in
|
|||||||
{
|
{
|
||||||
options.hardware = {
|
options.hardware = {
|
||||||
raspberry-pi."4".tv-hat = {
|
raspberry-pi."4".tv-hat = {
|
||||||
enable = lib.mkEnableOption ''
|
enable = lib.mkEnableOption "support for the Raspberry Pi TV Hat";
|
||||||
support for the Raspberry Pi TV Hat.
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|||||||
@@ -9,9 +9,7 @@ in
|
|||||||
{
|
{
|
||||||
options.hardware = {
|
options.hardware = {
|
||||||
raspberry-pi."4".xhci = {
|
raspberry-pi."4".xhci = {
|
||||||
enable = lib.mkEnableOption ''
|
enable = lib.mkEnableOption "builtin XHCI controller for USB with otg_mode=1 in config.txt";
|
||||||
Enable builtin XHCI controller for USB with otg_mode=1 in config.txt
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,299 @@
|
|||||||
|
# Compatibility function to allow flakes to be used by
|
||||||
|
# non-flake-enabled Nix versions. Given a source tree containing a
|
||||||
|
# 'flake.nix' and 'flake.lock' file, it fetches the flake inputs and
|
||||||
|
# calls the flake's 'outputs' function. It then returns an attrset
|
||||||
|
# containing 'defaultNix' (to be used in 'default.nix'), 'shellNix'
|
||||||
|
# (to be used in 'shell.nix').
|
||||||
|
|
||||||
|
{
|
||||||
|
src,
|
||||||
|
system ? builtins.currentSystem or "unknown-system",
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
lockFilePath = src + "/flake.lock";
|
||||||
|
|
||||||
|
lockFile = builtins.fromJSON (builtins.readFile lockFilePath);
|
||||||
|
|
||||||
|
fetchTree =
|
||||||
|
builtins.fetchTree or (
|
||||||
|
info:
|
||||||
|
if info.type == "github" then
|
||||||
|
{
|
||||||
|
outPath = fetchTarball (
|
||||||
|
{
|
||||||
|
url = "https://api.${info.host or "github.com"}/repos/${info.owner}/${info.repo}/tarball/${info.rev}";
|
||||||
|
}
|
||||||
|
// (if info ? narHash then { sha256 = info.narHash; } else { })
|
||||||
|
);
|
||||||
|
rev = info.rev;
|
||||||
|
shortRev = builtins.substring 0 7 info.rev;
|
||||||
|
lastModified = info.lastModified;
|
||||||
|
lastModifiedDate = formatSecondsSinceEpoch info.lastModified;
|
||||||
|
narHash = info.narHash;
|
||||||
|
}
|
||||||
|
else if info.type == "git" then
|
||||||
|
{
|
||||||
|
outPath = builtins.fetchGit (
|
||||||
|
{
|
||||||
|
url = info.url;
|
||||||
|
}
|
||||||
|
// (if info ? rev then { inherit (info) rev; } else { })
|
||||||
|
// (if info ? ref then { inherit (info) ref; } else { })
|
||||||
|
// (if info ? submodules then { inherit (info) submodules; } else { })
|
||||||
|
);
|
||||||
|
lastModified = info.lastModified;
|
||||||
|
lastModifiedDate = formatSecondsSinceEpoch info.lastModified;
|
||||||
|
narHash = info.narHash;
|
||||||
|
revCount = info.revCount or 0;
|
||||||
|
}
|
||||||
|
// (
|
||||||
|
if info ? rev then
|
||||||
|
{
|
||||||
|
rev = info.rev;
|
||||||
|
shortRev = builtins.substring 0 7 info.rev;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ }
|
||||||
|
)
|
||||||
|
else if info.type == "path" then
|
||||||
|
{
|
||||||
|
outPath = builtins.path {
|
||||||
|
path = info.path;
|
||||||
|
sha256 = info.narHash;
|
||||||
|
};
|
||||||
|
narHash = info.narHash;
|
||||||
|
}
|
||||||
|
else if info.type == "tarball" then
|
||||||
|
{
|
||||||
|
outPath = fetchTarball (
|
||||||
|
{ inherit (info) url; } // (if info ? narHash then { sha256 = info.narHash; } else { })
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else if info.type == "gitlab" then
|
||||||
|
{
|
||||||
|
inherit (info) rev narHash lastModified;
|
||||||
|
outPath = fetchTarball (
|
||||||
|
{
|
||||||
|
url = "https://${info.host or "gitlab.com"}/api/v4/projects/${info.owner}%2F${info.repo}/repository/archive.tar.gz?sha=${info.rev}";
|
||||||
|
}
|
||||||
|
// (if info ? narHash then { sha256 = info.narHash; } else { })
|
||||||
|
);
|
||||||
|
shortRev = builtins.substring 0 7 info.rev;
|
||||||
|
}
|
||||||
|
else if info.type == "sourcehut" then
|
||||||
|
{
|
||||||
|
inherit (info) rev narHash lastModified;
|
||||||
|
outPath = fetchTarball (
|
||||||
|
{
|
||||||
|
url = "https://${info.host or "git.sr.ht"}/${info.owner}/${info.repo}/archive/${info.rev}.tar.gz";
|
||||||
|
}
|
||||||
|
// (if info ? narHash then { sha256 = info.narHash; } else { })
|
||||||
|
);
|
||||||
|
shortRev = builtins.substring 0 7 info.rev;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
# FIXME: add Mercurial, tarball inputs.
|
||||||
|
throw "flake input has unsupported input type '${info.type}'"
|
||||||
|
);
|
||||||
|
|
||||||
|
callFlake4 =
|
||||||
|
flakeSrc: locks:
|
||||||
|
let
|
||||||
|
flake = import (flakeSrc + "/flake.nix");
|
||||||
|
|
||||||
|
inputs = builtins.mapAttrs (
|
||||||
|
_n: v:
|
||||||
|
if v.flake or true then
|
||||||
|
callFlake4 (fetchTree (v.locked // v.info)) v.inputs
|
||||||
|
else
|
||||||
|
fetchTree (v.locked // v.info)
|
||||||
|
) locks;
|
||||||
|
|
||||||
|
outputs = flakeSrc // (flake.outputs (inputs // { self = outputs; }));
|
||||||
|
in
|
||||||
|
assert flake.edition == 201909;
|
||||||
|
outputs;
|
||||||
|
|
||||||
|
callLocklessFlake =
|
||||||
|
flakeSrc:
|
||||||
|
let
|
||||||
|
flake = import (flakeSrc + "/flake.nix");
|
||||||
|
outputs = flakeSrc // (flake.outputs ({ self = outputs; }));
|
||||||
|
in
|
||||||
|
outputs;
|
||||||
|
|
||||||
|
rootSrc =
|
||||||
|
let
|
||||||
|
# Try to clean the source tree by using fetchGit, if this source
|
||||||
|
# tree is a valid git repository.
|
||||||
|
tryFetchGit =
|
||||||
|
src:
|
||||||
|
if isGit && !isShallow then
|
||||||
|
let
|
||||||
|
res = builtins.fetchGit src;
|
||||||
|
in
|
||||||
|
if res.rev == "0000000000000000000000000000000000000000" then
|
||||||
|
removeAttrs res [
|
||||||
|
"rev"
|
||||||
|
"shortRev"
|
||||||
|
]
|
||||||
|
else
|
||||||
|
res
|
||||||
|
else
|
||||||
|
{
|
||||||
|
outPath =
|
||||||
|
# Massage `src` into a store path.
|
||||||
|
if builtins.isPath src then
|
||||||
|
if
|
||||||
|
dirOf (toString src) == builtins.storeDir
|
||||||
|
# `builtins.storePath` is not available in pure-eval mode.
|
||||||
|
&& builtins ? currentSystem
|
||||||
|
then
|
||||||
|
# If it's already a store path, don't copy it again.
|
||||||
|
builtins.storePath src
|
||||||
|
else
|
||||||
|
"${src}"
|
||||||
|
else
|
||||||
|
src;
|
||||||
|
};
|
||||||
|
# NB git worktrees have a file for .git, so we don't check the type of .git
|
||||||
|
isGit = builtins.pathExists (src + "/.git");
|
||||||
|
isShallow = builtins.pathExists (src + "/.git/shallow");
|
||||||
|
|
||||||
|
in
|
||||||
|
{
|
||||||
|
lastModified = 0;
|
||||||
|
lastModifiedDate = formatSecondsSinceEpoch 0;
|
||||||
|
}
|
||||||
|
// (if src ? outPath then src else tryFetchGit src);
|
||||||
|
|
||||||
|
# Format number of seconds in the Unix epoch as %Y%m%d%H%M%S.
|
||||||
|
formatSecondsSinceEpoch =
|
||||||
|
t:
|
||||||
|
let
|
||||||
|
rem = x: y: x - x / y * y;
|
||||||
|
days = t / 86400;
|
||||||
|
secondsInDay = rem t 86400;
|
||||||
|
hours = secondsInDay / 3600;
|
||||||
|
minutes = (rem secondsInDay 3600) / 60;
|
||||||
|
seconds = rem t 60;
|
||||||
|
|
||||||
|
# Courtesy of https://stackoverflow.com/a/32158604.
|
||||||
|
z = days + 719468;
|
||||||
|
era = (if z >= 0 then z else z - 146096) / 146097;
|
||||||
|
doe = z - era * 146097;
|
||||||
|
yoe = (doe - doe / 1460 + doe / 36524 - doe / 146096) / 365;
|
||||||
|
y = yoe + era * 400;
|
||||||
|
doy = doe - (365 * yoe + yoe / 4 - yoe / 100);
|
||||||
|
mp = (5 * doy + 2) / 153;
|
||||||
|
d = doy - (153 * mp + 2) / 5 + 1;
|
||||||
|
m = mp + (if mp < 10 then 3 else -9);
|
||||||
|
y' = y + (if m <= 2 then 1 else 0);
|
||||||
|
|
||||||
|
pad = s: if builtins.stringLength s < 2 then "0" + s else s;
|
||||||
|
in
|
||||||
|
"${toString y'}${pad (toString m)}${pad (toString d)}${pad (toString hours)}${pad (toString minutes)}${pad (toString seconds)}";
|
||||||
|
|
||||||
|
allNodes = builtins.mapAttrs (
|
||||||
|
key: node:
|
||||||
|
let
|
||||||
|
sourceInfo =
|
||||||
|
if key == lockFile.root then
|
||||||
|
rootSrc
|
||||||
|
else
|
||||||
|
fetchTree (node.info or { } // removeAttrs node.locked [ "dir" ]);
|
||||||
|
|
||||||
|
subdir = if key == lockFile.root then "" else node.locked.dir or "";
|
||||||
|
|
||||||
|
outPath = sourceInfo + ((if subdir == "" then "" else "/") + subdir);
|
||||||
|
|
||||||
|
flake = import (outPath + "/flake.nix");
|
||||||
|
|
||||||
|
inputs = builtins.mapAttrs (_inputName: inputSpec: allNodes.${resolveInput inputSpec}) (
|
||||||
|
node.inputs or { }
|
||||||
|
);
|
||||||
|
|
||||||
|
# Resolve a input spec into a node name. An input spec is
|
||||||
|
# either a node name, or a 'follows' path from the root
|
||||||
|
# node.
|
||||||
|
resolveInput =
|
||||||
|
inputSpec: if builtins.isList inputSpec then getInputByPath lockFile.root inputSpec else inputSpec;
|
||||||
|
|
||||||
|
# Follow an input path (e.g. ["dwarffs" "nixpkgs"]) from the
|
||||||
|
# root node, returning the final node.
|
||||||
|
getInputByPath =
|
||||||
|
nodeName: path:
|
||||||
|
if path == [ ] then
|
||||||
|
nodeName
|
||||||
|
else
|
||||||
|
getInputByPath
|
||||||
|
# Since this could be a 'follows' input, call resolveInput.
|
||||||
|
(resolveInput lockFile.nodes.${nodeName}.inputs.${builtins.head path})
|
||||||
|
(builtins.tail path);
|
||||||
|
|
||||||
|
outputs = flake.outputs (inputs // { self = result; });
|
||||||
|
|
||||||
|
result =
|
||||||
|
outputs
|
||||||
|
# We add the sourceInfo attribute for its metadata, as they are
|
||||||
|
# relevant metadata for the flake. However, the outPath of the
|
||||||
|
# sourceInfo does not necessarily match the outPath of the flake,
|
||||||
|
# as the flake may be in a subdirectory of a source.
|
||||||
|
# This is shadowed in the next //
|
||||||
|
// sourceInfo
|
||||||
|
// {
|
||||||
|
# This shadows the sourceInfo.outPath
|
||||||
|
inherit outPath;
|
||||||
|
|
||||||
|
inherit inputs;
|
||||||
|
inherit outputs;
|
||||||
|
inherit sourceInfo;
|
||||||
|
_type = "flake";
|
||||||
|
};
|
||||||
|
|
||||||
|
in
|
||||||
|
if node.flake or true then
|
||||||
|
assert builtins.isFunction flake.outputs;
|
||||||
|
result
|
||||||
|
else
|
||||||
|
sourceInfo
|
||||||
|
) lockFile.nodes;
|
||||||
|
|
||||||
|
result =
|
||||||
|
if !(builtins.pathExists lockFilePath) then
|
||||||
|
callLocklessFlake rootSrc
|
||||||
|
else if lockFile.version == 4 then
|
||||||
|
callFlake4 rootSrc (lockFile.inputs)
|
||||||
|
else if lockFile.version >= 5 && lockFile.version <= 7 then
|
||||||
|
allNodes.${lockFile.root}
|
||||||
|
else
|
||||||
|
throw "lock file '${lockFilePath}' has unsupported version ${toString lockFile.version}";
|
||||||
|
|
||||||
|
in
|
||||||
|
rec {
|
||||||
|
outputs = result;
|
||||||
|
|
||||||
|
defaultNix =
|
||||||
|
builtins.removeAttrs result [ "__functor" ]
|
||||||
|
// (
|
||||||
|
if result ? defaultPackage.${system} then { default = result.defaultPackage.${system}; } else { }
|
||||||
|
)
|
||||||
|
// (
|
||||||
|
if result ? packages.${system}.default then
|
||||||
|
{ default = result.packages.${system}.default; }
|
||||||
|
else
|
||||||
|
{ }
|
||||||
|
);
|
||||||
|
|
||||||
|
shellNix =
|
||||||
|
defaultNix
|
||||||
|
// (if result ? devShell.${system} then { default = result.devShell.${system}; } else { })
|
||||||
|
// (
|
||||||
|
if result ? devShells.${system}.default then
|
||||||
|
{ default = result.devShells.${system}.default; }
|
||||||
|
else
|
||||||
|
{ }
|
||||||
|
);
|
||||||
|
}
|
||||||
Generated
+18
-57
@@ -1,78 +1,39 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"flake-parts": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs-lib": [
|
|
||||||
"nixos-unstable-small"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1743550720,
|
|
||||||
"narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=",
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "flake-parts",
|
|
||||||
"rev": "c621e8422220273271f52058f618c94e405bb0f5",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "flake-parts",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixos-hardware": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1747083103,
|
|
||||||
"narHash": "sha256-dMx20S2molwqJxbmMB4pGjNfgp5H1IOHNa1Eby6xL+0=",
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixos-hardware",
|
|
||||||
"rev": "d1d68fe8b00248caaa5b3bbe4984c12b47e0867d",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixos-hardware",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixos-stable": {
|
"nixos-stable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751211869,
|
"lastModified": 1755274400,
|
||||||
"narHash": "sha256-1Cu92i1KSPbhPCKxoiVG5qnoRiKTgR5CcGSRyLpOd7Y=",
|
"narHash": "sha256-rTInmnp/xYrfcMZyFMH3kc8oko5zYfxsowaLv1LVobY=",
|
||||||
"ref": "nixos-25.05",
|
"owner": "NixOS",
|
||||||
"rev": "b43c397f6c213918d6cfe6e3550abfe79b5d1c51",
|
"repo": "nixpkgs",
|
||||||
"shallow": true,
|
"rev": "ad7196ae55c295f53a7d1ec39e4a06d922f3b899",
|
||||||
"type": "git",
|
"type": "github"
|
||||||
"url": "https://github.com/NixOS/nixpkgs"
|
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
"ref": "nixos-25.05",
|
"ref": "nixos-25.05",
|
||||||
"shallow": true,
|
"repo": "nixpkgs",
|
||||||
"type": "git",
|
"type": "github"
|
||||||
"url": "https://github.com/NixOS/nixpkgs"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixos-unstable-small": {
|
"nixos-unstable-small": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1747040834,
|
"lastModified": 1755375481,
|
||||||
"narHash": "sha256-iKQKoNlZmxQq+O2WfImm/jn97g5GZBVW5EZEoCTXZ3I=",
|
"narHash": "sha256-43PgCQFgFD1nM/7dncytV0c5heNHe/gXrEud18ZWcZU=",
|
||||||
"ref": "nixos-unstable-small",
|
"owner": "NixOS",
|
||||||
"rev": "e4f52f3ea82ddd3754b467e3fdc0d709685c9a05",
|
"repo": "nixpkgs",
|
||||||
"shallow": true,
|
"rev": "35f1742e4f1470817ff8203185e2ce0359947f12",
|
||||||
"type": "git",
|
"type": "github"
|
||||||
"url": "https://github.com/NixOS/nixpkgs"
|
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
"ref": "nixos-unstable-small",
|
"ref": "nixos-unstable-small",
|
||||||
"shallow": true,
|
"repo": "nixpkgs",
|
||||||
"type": "git",
|
"type": "github"
|
||||||
"url": "https://github.com/NixOS/nixpkgs"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-parts": "flake-parts",
|
|
||||||
"nixos-hardware": "nixos-hardware",
|
|
||||||
"nixos-stable": "nixos-stable",
|
"nixos-stable": "nixos-stable",
|
||||||
"nixos-unstable-small": "nixos-unstable-small",
|
"nixos-unstable-small": "nixos-unstable-small",
|
||||||
"treefmt-nix": "treefmt-nix"
|
"treefmt-nix": "treefmt-nix"
|
||||||
|
|||||||
+4
-119
@@ -1,127 +1,12 @@
|
|||||||
{
|
{
|
||||||
description = "Test flake for nixos-hardware";
|
description = "Private dev inputs for nixos-hardware";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixos-unstable-small.url = "git+https://github.com/NixOS/nixpkgs?shallow=1&ref=nixos-unstable-small";
|
nixos-unstable-small.url = "github:NixOS/nixpkgs/nixos-unstable-small";
|
||||||
nixos-stable.url = "git+https://github.com/NixOS/nixpkgs?shallow=1&ref=nixos-25.05";
|
nixos-stable.url = "github:NixOS/nixpkgs/nixos-25.05";
|
||||||
# override in the test
|
|
||||||
nixos-hardware.url = "github:NixOS/nixos-hardware";
|
|
||||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
||||||
flake-parts.inputs.nixpkgs-lib.follows = "nixos-unstable-small";
|
|
||||||
treefmt-nix.url = "github:numtide/treefmt-nix";
|
treefmt-nix.url = "github:numtide/treefmt-nix";
|
||||||
treefmt-nix.inputs.nixpkgs.follows = "nixos-unstable-small";
|
treefmt-nix.inputs.nixpkgs.follows = "nixos-unstable-small";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs = inputs: inputs;
|
||||||
inputs@{ flake-parts, ... }:
|
|
||||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
|
||||||
imports = [
|
|
||||||
inputs.treefmt-nix.flakeModule
|
|
||||||
];
|
|
||||||
systems = [
|
|
||||||
"aarch64-linux"
|
|
||||||
"x86_64-linux"
|
|
||||||
"riscv64-linux"
|
|
||||||
];
|
|
||||||
perSystem =
|
|
||||||
{
|
|
||||||
system,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
blackList = [
|
|
||||||
# does import-from-derivation
|
|
||||||
"toshiba-swanky"
|
|
||||||
# uses custom nixpkgs config
|
|
||||||
"raspberry-pi-2"
|
|
||||||
|
|
||||||
# deprecated profiles
|
|
||||||
"framework"
|
|
||||||
"asus-zephyrus-ga402x"
|
|
||||||
"lenovo-yoga-7-14ARH7"
|
|
||||||
];
|
|
||||||
|
|
||||||
# There are more, but for those we need to force it.
|
|
||||||
# In future we should probably already define it in our module.
|
|
||||||
aarch64Systems = [
|
|
||||||
"raspberry-pi-3"
|
|
||||||
"raspberry-pi-4"
|
|
||||||
"raspberry-pi-5"
|
|
||||||
];
|
|
||||||
|
|
||||||
matchArch =
|
|
||||||
moduleName:
|
|
||||||
if builtins.elem moduleName aarch64Systems then
|
|
||||||
pkgs.hostPlatform.system == "aarch64-linux"
|
|
||||||
else
|
|
||||||
# TODO also add riscv64
|
|
||||||
pkgs.hostPlatform.system == "x86_64-linux";
|
|
||||||
|
|
||||||
modules = lib.filterAttrs (
|
|
||||||
name: _: !(builtins.elem name blackList || lib.hasPrefix "common-" name) && matchArch name
|
|
||||||
) inputs.nixos-hardware.nixosModules;
|
|
||||||
buildProfile = import ./build-profile.nix;
|
|
||||||
|
|
||||||
unfreeNixpkgs =
|
|
||||||
importPath:
|
|
||||||
import importPath {
|
|
||||||
config = {
|
|
||||||
allowBroken = true;
|
|
||||||
allowUnfree = true;
|
|
||||||
nvidia.acceptLicense = true;
|
|
||||||
};
|
|
||||||
overlays = [ ];
|
|
||||||
inherit system;
|
|
||||||
};
|
|
||||||
nixpkgsUnstable = unfreeNixpkgs inputs.nixos-unstable-small;
|
|
||||||
nixpkgsStable = unfreeNixpkgs inputs.nixos-stable;
|
|
||||||
|
|
||||||
checksForNixpkgs =
|
|
||||||
channel: nixpkgs:
|
|
||||||
lib.mapAttrs' (
|
|
||||||
name: module:
|
|
||||||
lib.nameValuePair "${channel}-${name}" (buildProfile {
|
|
||||||
pkgs = nixpkgs;
|
|
||||||
profile = module;
|
|
||||||
})
|
|
||||||
) modules;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
_module.args.pkgs = nixpkgsUnstable;
|
|
||||||
|
|
||||||
treefmt = {
|
|
||||||
flakeCheck = pkgs.hostPlatform.system != "riscv64-linux";
|
|
||||||
projectRootFile = "COPYING";
|
|
||||||
programs = {
|
|
||||||
deadnix = {
|
|
||||||
enable = true;
|
|
||||||
no-lambda-pattern-names = true;
|
|
||||||
};
|
|
||||||
nixfmt = {
|
|
||||||
enable = true;
|
|
||||||
package = pkgs.nixfmt-rfc-style;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
settings = {
|
|
||||||
on-unmatched = "info";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
checks =
|
|
||||||
checksForNixpkgs "nixos-unstable" nixpkgsUnstable
|
|
||||||
// checksForNixpkgs "nixos-stable" nixpkgsStable;
|
|
||||||
packages.run = pkgs.writeShellScriptBin "run.py" ''
|
|
||||||
#!${pkgs.bash}/bin/bash
|
|
||||||
export PATH=${
|
|
||||||
lib.makeBinPath [
|
|
||||||
pkgs.nix-eval-jobs
|
|
||||||
pkgs.nix-eval-jobs.nix
|
|
||||||
]
|
|
||||||
}
|
|
||||||
exec ${pkgs.python3.interpreter} ${./.}/run.py --nixos-hardware "$@"
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
{
|
||||||
|
self,
|
||||||
|
privateInputs,
|
||||||
|
system,
|
||||||
|
pkgs,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
# Hardware profile checks
|
||||||
|
blackList = [
|
||||||
|
# does import-from-derivation
|
||||||
|
"toshiba-swanky"
|
||||||
|
# uses custom nixpkgs config
|
||||||
|
"raspberry-pi-2"
|
||||||
|
# deprecated profiles
|
||||||
|
"framework"
|
||||||
|
"asus-zephyrus-ga402x"
|
||||||
|
"lenovo-yoga-7-14ARH7"
|
||||||
|
];
|
||||||
|
|
||||||
|
aarch64Systems = [
|
||||||
|
"raspberry-pi-3"
|
||||||
|
"raspberry-pi-4"
|
||||||
|
"raspberry-pi-5"
|
||||||
|
"nxp-imx8mp-evk"
|
||||||
|
"nxp-imx8mq-evk"
|
||||||
|
"nxp-imx8qm-mek"
|
||||||
|
"nxp-imx93-evk"
|
||||||
|
"ucm-imx95"
|
||||||
|
];
|
||||||
|
|
||||||
|
matchArch =
|
||||||
|
moduleName:
|
||||||
|
if builtins.elem moduleName aarch64Systems then
|
||||||
|
system == "aarch64-linux"
|
||||||
|
else
|
||||||
|
# TODO also add riscv64
|
||||||
|
system == "x86_64-linux";
|
||||||
|
|
||||||
|
modules = pkgs.lib.filterAttrs (
|
||||||
|
name: _: !(builtins.elem name blackList || pkgs.lib.hasPrefix "common-" name) && matchArch name
|
||||||
|
) self.nixosModules;
|
||||||
|
|
||||||
|
buildProfile = import ./build-profile.nix;
|
||||||
|
|
||||||
|
unfreeNixpkgs = {
|
||||||
|
config = {
|
||||||
|
allowBroken = true;
|
||||||
|
allowUnfree = true;
|
||||||
|
nvidia.acceptLicense = true;
|
||||||
|
};
|
||||||
|
overlays = [ ];
|
||||||
|
inherit system;
|
||||||
|
};
|
||||||
|
|
||||||
|
nixpkgsUnstable = import privateInputs.nixos-unstable-small unfreeNixpkgs;
|
||||||
|
nixpkgsStable = import privateInputs.nixos-stable unfreeNixpkgs;
|
||||||
|
|
||||||
|
# Build checks for both unstable and stable
|
||||||
|
unstableChecks = pkgs.lib.mapAttrs' (
|
||||||
|
name: module:
|
||||||
|
pkgs.lib.nameValuePair "unstable-${name}" (buildProfile {
|
||||||
|
pkgs = nixpkgsUnstable;
|
||||||
|
profile = module;
|
||||||
|
})
|
||||||
|
) modules;
|
||||||
|
|
||||||
|
stableChecks = pkgs.lib.mapAttrs' (
|
||||||
|
name: module:
|
||||||
|
pkgs.lib.nameValuePair "stable-${name}" (buildProfile {
|
||||||
|
pkgs = nixpkgsStable;
|
||||||
|
profile = module;
|
||||||
|
})
|
||||||
|
) modules;
|
||||||
|
in
|
||||||
|
unstableChecks // stableChecks
|
||||||
Loaded 100 of 104 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user