modules: add enable option guards#152
Open
JamieMagee wants to merge 1 commit into
Open
Conversation
26999ef to
fe70b33
Compare
Add hardware.raspberry-pi.<module>.enable options (defaulting to true) with mkIf guards to: bluetooth, display-vc4, display-rp1, usb-gadget-ethernet, pisugar-3, and nice-looking-console. This lets users import a module without unconditionally activating it, while preserving backward compatibility for existing configurations.
fe70b33 to
43622ed
Compare
|
Same issue with the nixos-raspberrypi/modules/raspberrypi.nix Lines 12 to 14 in 8d5d90f I noticed this when wanting to set |
Merged
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.
Right now, importing any of these modules (bluetooth, display-vc4, display-rp1, usb-gadget-ethernet, pisugar-3, nice-looking-console) immediately activates their config. There's no way to import one just to inspect its options or conditionally disable it in a higher-level config.
The NixOS module convention is to gate side effects behind an
enableoption withmkIf, so that's what this does. Each module gets ahardware.raspberry-pi.<module>.enableoption. They all default totrueto avoid breaking anyone's existing setup.