Skip to content

Commit fb5a14b

Browse files
authored
Merge branch 'NixOS:master' into master
2 parents 0310772 + daa628a commit fb5a14b

File tree

7 files changed

+69
-12
lines changed

7 files changed

+69
-12
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ See code for all available configurations.
305305
| [Lenovo ThinkPad X1 (10th Gen)](lenovo/thinkpad/x1/10th-gen) | `<nixos-hardware/lenovo/thinkpad/x1/10th-gen>` |
306306
| [Lenovo ThinkPad X1 (11th Gen)](lenovo/thinkpad/x1/11th-gen) | `<nixos-hardware/lenovo/thinkpad/x1/11th-gen>` |
307307
| [Lenovo ThinkPad X1 (12th Gen)](lenovo/thinkpad/x1/12th-gen) | `<nixos-hardware/lenovo/thinkpad/x1/12th-gen>` |
308+
| [Lenovo ThinkPad X1 (13th Gen)](lenovo/thinkpad/x1/13th-gen) | `<nixos-hardware/lenovo/thinkpad/x1/13th-gen>` |
308309
| [Lenovo ThinkPad X1 Extreme Gen 2](lenovo/thinkpad/x1-extreme/gen2) | `<nixos-hardware/lenovo/thinkpad/x1-extreme/gen2>` |
309310
| [Lenovo ThinkPad X1 Extreme Gen 3](lenovo/thinkpad/x1-extreme/gen3) | `<nixos-hardware/lenovo/thinkpad/x1-extreme/gen3>` |
310311
| [Lenovo ThinkPad X1 Extreme Gen 4](lenovo/thinkpad/x1-extreme/gen4) | `<nixos-hardware/lenovo/thinkpad/x1-extreme/gen4>` |

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@
249249
lenovo-thinkpad-x1-10th-gen = import ./lenovo/thinkpad/x1/10th-gen;
250250
lenovo-thinkpad-x1-11th-gen = import ./lenovo/thinkpad/x1/11th-gen;
251251
lenovo-thinkpad-x1-12th-gen = import ./lenovo/thinkpad/x1/12th-gen;
252+
lenovo-thinkpad-x1-13th-gen = import ./lenovo/thinkpad/x1/13th-gen;
252253
lenovo-thinkpad-x1-extreme = import ./lenovo/thinkpad/x1-extreme;
253254
lenovo-thinkpad-x1-extreme-gen2 = import ./lenovo/thinkpad/x1-extreme/gen2;
254255
lenovo-thinkpad-x1-extreme-gen3 = import ./lenovo/thinkpad/x1-extreme/gen3;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{lib, ...}:
2+
3+
{
4+
imports = [
5+
../../../../common/pc/ssd
6+
../../../../common/cpu/intel/lunar-lake
7+
];
8+
9+
hardware.trackpoint.device = "TPPS/2 Synaptics TrackPoint";
10+
11+
services.thermald.enable = lib.mkDefault true;
12+
}

nxp/imx8mp-evk/bsp/imx8mp-boot.nix

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,21 @@ with pkgs; let
1515
imx8mp-firmware = pkgs.callPackage ./imx8mp-firmware.nix {};
1616
imx8mp-uboot = pkgs.callPackage ./imx8mp-uboot.nix {};
1717
imx8mp-optee-os = pkgs.callPackage ./imx8mp-optee-os.nix {};
18+
src = pkgs.fetchgit {
19+
url = "https://github.com/nxp-imx/imx-mkimage.git";
20+
rev = "c4365450fb115d87f245df2864fee1604d97c06a";
21+
sha256 = "sha256-KVIVHwBpAwd1RKy3RrYxGIniE45CDlN5RQTXsMg1Jwk=";
22+
};
23+
shortRev = builtins.substring 0 8 src.rev;
1824
in {
1925
imx8m-boot = pkgs.stdenv.mkDerivation rec {
26+
inherit src;
2027
name = "imx8mp-mkimage";
2128
version = "lf-6.1.55-2.2.0";
22-
src = pkgs.fetchgit {
23-
url = "https://github.com/nxp-imx/imx-mkimage.git";
24-
rev = "c4365450fb115d87f245df2864fee1604d97c06a";
25-
sha256 = "sha256-xycEaWKVM63BlDyBKNN0OefyK6iX/fQOTvv4fRVM55U=";
26-
leaveDotGit = true;
27-
};
2829

2930
postPatch = ''
31+
substituteInPlace Makefile \
32+
--replace 'git rev-parse --short=8 HEAD' 'echo ${shortRev}'
3033
substituteInPlace Makefile \
3134
--replace 'CC = gcc' 'CC = clang'
3235
patchShebangs scripts

nxp/imx8mq-evk/bsp/imx8mq-boot.nix

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,21 @@ with pkgs; let
1414
imx8mq-firmware = pkgs.callPackage ./imx8mq-firmware.nix {};
1515
imx8mq-uboot = pkgs.callPackage ./imx8mq-uboot.nix {};
1616
imx8mq-optee-os = pkgs.callPackage ./imx8mq-optee-os.nix {};
17+
src = pkgs.fetchgit {
18+
url = "https://github.com/nxp-imx/imx-mkimage.git";
19+
rev = "c4365450fb115d87f245df2864fee1604d97c06a";
20+
sha256 = "sha256-KVIVHwBpAwd1RKy3RrYxGIniE45CDlN5RQTXsMg1Jwk=";
21+
};
22+
shortRev = builtins.substring 0 8 src.rev;
1723
in {
1824
imx8m-boot = pkgs.stdenv.mkDerivation rec {
25+
inherit src;
1926
name = "imx8mq-mkimage";
2027
version = "lf-6.1.55-2.2.0";
21-
src = pkgs.fetchgit {
22-
url = "https://github.com/nxp-imx/imx-mkimage.git";
23-
rev = "c4365450fb115d87f245df2864fee1604d97c06a";
24-
sha256 = "sha256-xycEaWKVM63BlDyBKNN0OefyK6iX/fQOTvv4fRVM55U=";
25-
leaveDotGit = true;
26-
};
2728

2829
postPatch = ''
30+
substituteInPlace Makefile \
31+
--replace 'git rev-parse --short=8 HEAD' 'echo ${shortRev}'
2932
substituteInPlace Makefile \
3033
--replace 'CC = gcc' 'CC = clang'
3134
patchShebangs scripts

raspberry-pi/4/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
./cpu-revision.nix
99
./digi-amp-plus.nix
1010
./dwc2.nix
11+
./gpio.nix
1112
./i2c.nix
1213
./leds.nix
1314
./modesetting.nix

raspberry-pi/4/gpio.nix

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{ pkgs, lib, config, ... }:
2+
{
3+
options.hardware.raspberry-pi."4".gpio = {
4+
enable = lib.mkOption {
5+
type = lib.types.bool;
6+
description =
7+
"Enable udev rules and kernelParams that make lgpio and pigpio work";
8+
default = false;
9+
};
10+
};
11+
config = let
12+
cfg = config.hardware.raspberry-pi."4".gpio;
13+
in
14+
lib.mkIf cfg.enable {
15+
users.groups.gpio = lib.mkDefault { };
16+
17+
# the bit that matters to lgpio here is
18+
# "${pkgs.coreutils}/bin/chgrp gpio /dev/%k && chmod 660 /dev/%k"
19+
# see https://github.com/NixOS/nixpkgs/pull/352308
20+
21+
# sudo udevadm test --action=add /dev/gpiochip0 to test
22+
23+
# import lgpio; lgpio.gpiochip_open(0) should show "1" and not raise
24+
# an exception
25+
26+
services.udev.extraRules = lib.mkBefore ''
27+
KERNEL=="gpiomem", GROUP="gpio", MODE="0660"
28+
SUBSYSTEM=="gpio", KERNEL=="gpiochip*", ACTION=="add", PROGRAM="${pkgs.bash}/bin/bash -c '${pkgs.coreutils}/bin/chgrp gpio /dev/%k && chmod 660 /dev/%k && ${pkgs.coreutils}/bin/chgrp -R gpio /sys/class/gpio && ${pkgs.coreutils}/bin/chmod -R g=u /sys/class/gpio'"
29+
SUBSYSTEM=="gpio", ACTION=="add", PROGRAM="${pkgs.bash}/bin/bash -c '${pkgs.coreutils}/bin/chgrp -R gpio /sys%p && ${pkgs.coreutils}/bin/chmod -R g=u /sys%p'"
30+
'';
31+
32+
boot.kernelParams = [
33+
"iomem=relaxed" # for pigpiod
34+
];
35+
};
36+
}

0 commit comments

Comments
 (0)