10.nixos-hardware/raspberry-pi/common/config-txt-defaults.nix
Jamie Magee a688dfcbb5 raspberry-pi: add config.txt generation module
Two new files in raspberry-pi/common/:

config-txt.nix lets you declare config.txt contents through
hardware.raspberry-pi.configtxt.settings (RFC 42 style — plain
values, null to remove, no enable/value wrappers).

config-txt-defaults.nix has the same defaults as Raspberry Pi OS:
vc4-kms-v3d, audio on, arm_boost, CM4 otg_mode, CM5 dwc2, etc.
All mkDefault so they are easy to override.

Not wired into board profiles yet — that comes with the RPi 5
sub-module work. Based on nvmd/nixos-raspberrypi.
2026-03-08 23:18:35 -07:00

29 lines
910 B
Nix

# Default config.txt settings matching the official Raspberry Pi OS defaults.
#
# Source: https://github.com/RPi-Distro/pi-gen/blob/master/stage1/00-boot-files/files/config.txt
# All values use mkDefault so they can be easily overridden.
#
# Reference: https://www.raspberrypi.com/documentation/computers/config_txt.html
{ lib, ... }:
{
hardware.raspberry-pi.configtxt.settings = {
all = {
camera_auto_detect = lib.mkDefault true;
display_auto_detect = lib.mkDefault true;
max_framebuffers = lib.mkDefault 2;
disable_fw_kms_setup = lib.mkDefault true;
disable_overscan = lib.mkDefault true;
arm_boost = lib.mkDefault true;
dtparam = lib.mkDefault [ "audio=on" ];
dtoverlay = lib.mkDefault [ "vc4-kms-v3d" ];
};
cm4 = {
otg_mode = lib.mkDefault true;
};
cm5 = {
dtoverlay = lib.mkDefault [ "dwc2,dr_mode=host" ];
};
};
}