raspberry-pi: add config.txt generation module#1788
Open
JamieMagee wants to merge 2 commits intoNixOS:masterfrom
Open
raspberry-pi: add config.txt generation module#1788JamieMagee wants to merge 2 commits intoNixOS:masterfrom
JamieMagee wants to merge 2 commits intoNixOS:masterfrom
Conversation
quentinmit
reviewed
Mar 9, 2026
Member
Author
|
@quentinmit Thanks for the review! I pushed a rework that covers everything you raised. |
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.
2b1b66b to
a688dfc
Compare
quentinmit
reviewed
Mar 10, 2026
null was not in the settings type, so mkForce null to remove a default was a type error. Added nullOr to atom and filter nulls in recurse. Changed file from types.str to types.path with pkgs.writeText — this is how services.mysql.configFile and similar options work. Moved the generated file into the option default (with defaultText) rather than setting it in the config block.
8fbb4ed to
b4766ff
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two new files in
raspberry-pi/common/for generating Raspberry Pi config.txt from Nix.config-txt.nixaddshardware.raspberry-pi.configtxt.settings, which covers options, dtparam, dtoverlay, and conditional filters ([pi5],[cm4], etc.).config-txt-defaults.nixships the standard Raspberry Pi OS defaults1, allmkDefault.Not exposed in flake.nix. These are internal, meant to be imported by board profiles once the RPi 5 sub-module work follows. Doesn't write to
/boot/firmware/yet, that needs the bootloader module.Context: porting config.txt infrastructure from nvmd/nixos-raspberrypi (see nvmd/nixos-raspberrypi#78).
Footnotes
https://github.com/RPi-Distro/pi-gen/blob/master/stage1/00-boot-files/files/config.txt ↩