[release-25.05] Add mkEnableTargetWith and use it for documenting dynamic autoEnable conditions#1470
Merged
danth merged 7 commits intorelease-25.05from Jun 9, 2025
Merged
Conversation
(cherry picked from commit df428b5)
Drop the redundant "same as" prefix and instead use a `literalExpression`. Co-authored-by: NAHO <90870942+trueNAHO@users.noreply.github.com> (cherry picked from commit 93eb9c5)
Refactor `mkEnableTarget` and `mkEnableWallpaper` to use `mkEnableIf`. (cherry picked from commit 92276a1)
(cherry picked from commit a4d92fe)
This allows correctly documenting dynamic enable conditions.
E.g:
```nix
enable = mkEnableTargetWith {
name = "QT";
autoEnable = pkgs.stdenv.hostPlatform.isLinux;
autoEnableExpr = "pkgs.stdenv.hostPlatform.isLinux";
};
```
`autoEnableExpr` will be wrapped in parentheses if it contains a nix
operator with lower precedence than `&&`.
Added a note in the docs mentioning `mkEnableTarget` should either have
a static `autoEnable` or specify `autoEnableExpr`.
(cherry picked from commit 0449dae)
(cherry picked from commit 67b4644)
Ensure enable options with dynamic `autoEnable` are documented correctly. (cherry picked from commit 289356d)
5 tasks
danth
approved these changes
Jun 9, 2025
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.
This is an automated backport of #1244.