From eb9e8e10ac733256bac2dc2af89a3075ce6111aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Wed, 8 Oct 2025 15:42:59 +0200 Subject: [PATCH] raspberrypi/4: fix many option rendering --- raspberry-pi/4/audio.nix | 4 +--- raspberry-pi/4/backlight.nix | 4 +--- raspberry-pi/4/bluetooth.nix | 4 +--- raspberry-pi/4/digi-amp-plus.nix | 6 ++---- raspberry-pi/4/dwc2.nix | 33 ++++++++++++++++++-------------- raspberry-pi/4/i2c.nix | 24 +++++++++++++---------- raspberry-pi/4/pkgs-overlays.nix | 10 ++++++---- raspberry-pi/4/poe-hat.nix | 4 +--- raspberry-pi/4/poe-plus-hat.nix | 4 +--- raspberry-pi/4/pwm0.nix | 4 +--- raspberry-pi/4/tc358743.nix | 24 +++++++++++++---------- raspberry-pi/4/touch-ft5406.nix | 18 +++++++++-------- raspberry-pi/4/tv-hat.nix | 6 ++---- raspberry-pi/4/xhci.nix | 4 +--- 14 files changed, 74 insertions(+), 75 deletions(-) diff --git a/raspberry-pi/4/audio.nix b/raspberry-pi/4/audio.nix index 08c0b921..7241b2cf 100644 --- a/raspberry-pi/4/audio.nix +++ b/raspberry-pi/4/audio.nix @@ -11,9 +11,7 @@ in { options.hardware = { raspberry-pi."4".audio = { - enable = lib.mkEnableOption '' - configuration for audio - ''; + enable = lib.mkEnableOption "configuration for audio"; }; }; diff --git a/raspberry-pi/4/backlight.nix b/raspberry-pi/4/backlight.nix index 31c0e906..e0ce8d56 100644 --- a/raspberry-pi/4/backlight.nix +++ b/raspberry-pi/4/backlight.nix @@ -6,9 +6,7 @@ in { options.hardware = { raspberry-pi."4".backlight = { - enable = lib.mkEnableOption '' - Enable the backlight support for the Raspberry Pi official Touch Display - ''; + enable = lib.mkEnableOption "the backlight support for the Raspberry Pi official Touch Display"; }; }; diff --git a/raspberry-pi/4/bluetooth.nix b/raspberry-pi/4/bluetooth.nix index 78619bcd..6a0f6323 100644 --- a/raspberry-pi/4/bluetooth.nix +++ b/raspberry-pi/4/bluetooth.nix @@ -6,9 +6,7 @@ in { options.hardware = { raspberry-pi."4".bluetooth = { - enable = lib.mkEnableOption '' - configuration for bluetooth - ''; + enable = lib.mkEnableOption "configuration for bluetooth"; }; }; diff --git a/raspberry-pi/4/digi-amp-plus.nix b/raspberry-pi/4/digi-amp-plus.nix index 3c19f3a8..f9a3a5b3 100644 --- a/raspberry-pi/4/digi-amp-plus.nix +++ b/raspberry-pi/4/digi-amp-plus.nix @@ -6,15 +6,13 @@ in { options.hardware = { raspberry-pi."4".digi-amp-plus = { - enable = lib.mkEnableOption '' - support for the IQaudIO DigiAMP+ Hat. - ''; + enable = lib.mkEnableOption "support for the IQaudIO DigiAMP+ Hat"; unmuteAmp = lib.mkOption { type = lib.types.bool; default = false; description = '' - "one-shot" unmute when kernel module first loads. + Whether to "one-shot" unmute when kernel module first loads. ''; }; diff --git a/raspberry-pi/4/dwc2.nix b/raspberry-pi/4/dwc2.nix index 874efa24..5d49f9a1 100644 --- a/raspberry-pi/4/dwc2.nix +++ b/raspberry-pi/4/dwc2.nix @@ -6,24 +6,29 @@ in { options.hardware = { raspberry-pi."4".dwc2 = { - enable = lib.mkEnableOption '' - Enable the UDC controller to support USB OTG gadget functions. + enable = lib.mkOption { + type = lib.types.bool; + default = false; + example = true; + description = '' + Enable the UDC controller to support USB OTG gadget functions. - In order to verify that this works, connect the Raspberry Pi with - another computer via the USB C cable, and then do one of: + In order to verify that this works, connect the Raspberry Pi with + another computer via the USB C cable, and then do one of: - - `modprobe g_serial` - - `modprobe g_mass_storage file=/path/to/some/iso-file.iso` + - `modprobe g_serial` + - `modprobe g_mass_storage file=/path/to/some/iso-file.iso` - On the Raspberry Pi, `dmesg` should then show success-indicating output - that is related to the dwc2 and g_serial/g_mass_storage modules. - On the other computer, a serial/mass-storage device should pop up in - the system logs. + On the Raspberry Pi, `dmesg` should then show success-indicating output + that is related to the dwc2 and g_serial/g_mass_storage modules. + On the other computer, a serial/mass-storage device should pop up in + the system logs. - For more information about what gadget functions exist along with handy - guides on how to test them, please refer to: - https://www.kernel.org/doc/Documentation/usb/gadget-testing.txt - ''; + For more information about what gadget functions exist along with handy + guides on how to test them, please refer to: + https://www.kernel.org/doc/Documentation/usb/gadget-testing.txt + ''; + }; dr_mode = lib.mkOption { type = lib.types.enum [ "host" diff --git a/raspberry-pi/4/i2c.nix b/raspberry-pi/4/i2c.nix index 5939a78a..a03eccd0 100644 --- a/raspberry-pi/4/i2c.nix +++ b/raspberry-pi/4/i2c.nix @@ -31,28 +31,32 @@ in { options.hardware.raspberry-pi."4" = { i2c0 = { - enable = lib.mkEnableOption '' - 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. - ''; + enable = lib.mkEnableOption "" // { + description = '' + 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. + ''; + }; frequency = lib.mkOption { type = lib.types.nullOr lib.types.int; default = null; description = '' - interface clock-frequency + The interface clock-frequency to configure. ''; }; }; i2c1 = { - enable = lib.mkEnableOption '' - 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. - ''; + 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. + After a reboot, i2c-tools (e.g. i2cdetect -F 1) should work for root or any user in i2c. + ''; + }; frequency = lib.mkOption { type = lib.types.nullOr lib.types.int; default = null; description = '' - interface clock-frequency + The interface clock-frequency to configure. ''; }; }; diff --git a/raspberry-pi/4/pkgs-overlays.nix b/raspberry-pi/4/pkgs-overlays.nix index 95109c21..f36577a5 100644 --- a/raspberry-pi/4/pkgs-overlays.nix +++ b/raspberry-pi/4/pkgs-overlays.nix @@ -10,10 +10,12 @@ in { options.hardware = { raspberry-pi."4".apply-overlays-dtmerge = { - enable = lib.mkEnableOption '' - replace deviceTree.applyOverlays implementation to use dtmerge from libraspberrypi. - this can resolve issues with applying dtbs for the pi. - ''; + enable = lib.mkEnableOption "" // { + description = '' + Whether replace deviceTree.applyOverlays implementation to use dtmerge from libraspberrypi. + This can resolve issues with applying dtbs for the pi. + ''; + }; }; }; diff --git a/raspberry-pi/4/poe-hat.nix b/raspberry-pi/4/poe-hat.nix index 0eb8d847..3ec29db3 100644 --- a/raspberry-pi/4/poe-hat.nix +++ b/raspberry-pi/4/poe-hat.nix @@ -6,9 +6,7 @@ in { options.hardware = { raspberry-pi."4".poe-hat = { - enable = lib.mkEnableOption '' - support for the Raspberry Pi POE Hat. - ''; + enable = lib.mkEnableOption "support for the Raspberry Pi POE Hat"; }; }; diff --git a/raspberry-pi/4/poe-plus-hat.nix b/raspberry-pi/4/poe-plus-hat.nix index 985971f3..b6d1fa3f 100644 --- a/raspberry-pi/4/poe-plus-hat.nix +++ b/raspberry-pi/4/poe-plus-hat.nix @@ -6,9 +6,7 @@ in { options.hardware = { raspberry-pi."4".poe-plus-hat = { - enable = lib.mkEnableOption '' - support for the Raspberry Pi PoE+ HAT. - ''; + enable = lib.mkEnableOption "support for the Raspberry Pi PoE+ HAT"; }; }; diff --git a/raspberry-pi/4/pwm0.nix b/raspberry-pi/4/pwm0.nix index 665f81be..da93a767 100644 --- a/raspberry-pi/4/pwm0.nix +++ b/raspberry-pi/4/pwm0.nix @@ -6,9 +6,7 @@ in { options.hardware = { raspberry-pi."4".pwm0 = { - enable = lib.mkEnableOption '' - Enable support for the hardware pwm0 channel on GPIO_18 - ''; + enable = lib.mkEnableOption "support for the hardware pwm0 channel on GPIO_18"; }; }; diff --git a/raspberry-pi/4/tc358743.nix b/raspberry-pi/4/tc358743.nix index 6dc9f76d..02015e73 100644 --- a/raspberry-pi/4/tc358743.nix +++ b/raspberry-pi/4/tc358743.nix @@ -6,13 +6,15 @@ in { options.hardware = { raspberry-pi."4".tc358743 = { - enable = lib.mkEnableOption '' - Enable support for the Toshiba TC358743 HDMI-to-CSI-2 converter. + enable = lib.mkEnableOption "" // { + description = '' + Enable support for the Toshiba TC358743 HDMI-to-CSI-2 converter. - This can be tested with a plugged in converter device and for example - running ustreamer (which starts webservice providing a camera stream): - ''${pkgs.ustreamer}/bin/ustreamer --persistent --dv-timings - ''; + This can be tested with a plugged in converter device and for example + running ustreamer (which starts webservice providing a camera stream): + ''${pkgs.ustreamer}/bin/ustreamer --persistent --dv-timings + ''; + }; lanes = lib.mkOption { type = lib.types.enum [ 2 @@ -23,11 +25,13 @@ in Number of CSI lanes available ''; }; - media-controller = lib.mkEnableOption '' - Enable support for the Media Controller API. + media-controller = lib.mkEnableOption "" // { + description = '' + 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 + ''; + }; }; }; diff --git a/raspberry-pi/4/touch-ft5406.nix b/raspberry-pi/4/touch-ft5406.nix index 5cc0a70f..3c8acdb2 100644 --- a/raspberry-pi/4/touch-ft5406.nix +++ b/raspberry-pi/4/touch-ft5406.nix @@ -6,16 +6,18 @@ in { options.hardware = { raspberry-pi."4".touch-ft5406 = { - enable = lib.mkEnableOption '' - Enable the touch controller of the official Raspberry Pi touch diplay. + enable = lib.mkEnableOption "" // { + description = '' + Enable the touch controller of the official Raspberry Pi touch diplay. - The overlay is taken from the official Raspberry Pi Linux fork, and - the `compatible` field is updated to match the target device tree. - https://github.com/raspberrypi/linux/blob/14b35093ca68bf2c81bbc90aace5007142b40b40/arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts + The overlay is taken from the official Raspberry Pi Linux fork, and + the `compatible` field is updated to match the target device tree. + https://github.com/raspberrypi/linux/blob/14b35093ca68bf2c81bbc90aace5007142b40b40/arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts - For more information about the touch display, please refer to: - https://www.raspberrypi.com/documentation/accessories/display.html - ''; + For more information about the touch display, please refer to: + https://www.raspberrypi.com/documentation/accessories/display.html + ''; + }; }; }; diff --git a/raspberry-pi/4/tv-hat.nix b/raspberry-pi/4/tv-hat.nix index 263d6fcf..5ff9ca93 100644 --- a/raspberry-pi/4/tv-hat.nix +++ b/raspberry-pi/4/tv-hat.nix @@ -6,9 +6,7 @@ in { options.hardware = { raspberry-pi."4".tv-hat = { - enable = lib.mkEnableOption '' - support for the Raspberry Pi TV Hat. - ''; + enable = lib.mkEnableOption "support for the Raspberry Pi TV Hat"; }; }; config = lib.mkIf cfg.enable { @@ -22,7 +20,7 @@ in dtsText = " /dts-v1/; /plugin/; - + /{ compatible = \"brcm,bcm2711\"; fragment@0 { diff --git a/raspberry-pi/4/xhci.nix b/raspberry-pi/4/xhci.nix index eb1d2ada..56503df3 100644 --- a/raspberry-pi/4/xhci.nix +++ b/raspberry-pi/4/xhci.nix @@ -9,9 +9,7 @@ in { options.hardware = { raspberry-pi."4".xhci = { - enable = lib.mkEnableOption '' - Enable builtin XHCI controller for USB with otg_mode=1 in config.txt - ''; + enable = lib.mkEnableOption "builtin XHCI controller for USB with otg_mode=1 in config.txt"; }; };