Mark experimental configuration settings programmatically#8196
Mark experimental configuration settings programmatically#8196roberth merged 2 commits intoNixOS:masterfrom
Conversation
09829cb to
9d58840
Compare
|
OK Fixed the unit tests. |
| > **Warning** | ||
| > This setting is part of an experimental feature. | ||
|
|
||
| To change this setting, you need to make sure the corresponding experimental feature, | ||
| [`${experimental-feature}`](@docroot@/contributing/experimental-features.md#xp-feature-${experimental-feature}), | ||
| is enabled. | ||
| For example, include the following in [`nix.conf`](#): |
There was a problem hiding this comment.
We should explain when to use it and when not to use it, probably by linking the a page about experimental features?
There was a problem hiding this comment.
The section on the specific experimental feature is the same page, but also I made the warning above link the page as a whole (not URL fragment).
doc/manual/utils.nix
Outdated
| body = '' | ||
| ${description} | ||
|
|
||
| '' + (if experimental-feature != null then '' |
There was a problem hiding this comment.
I feel like string interpolation looks cleaner, but feel free to ignore.
In Nixpkgs I would also say lib.optionalString, but that may not apply here.
There was a problem hiding this comment.
I agree with that, and recommend following my example of creating helper functions with self-explanatory names when inline expressions get out of hand.
There was a problem hiding this comment.
Added optionalString in a preparatory commit, and used it in a bunch of other places too.
722199b to
6db3dcb
Compare
Use it everywhere it could be also.
Fix NixOS#8162 The test is changed to compare `nlohmann::json` values, not strings of dumped JSON, which allows us to format things more nicely.
| > **Warning** | ||
| > This is an experimental feature. | ||
|
|
||
| To enable it, add the following to [`nix.conf`](#): |
There was a problem hiding this comment.
OT: Which nix.conf?
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
|
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
Motivation
Fix #8162
Context
The test is changed to compare
nlohmann::jsonvalues, not strings of dumped JSON, which allows us to format things more nicely.This is somewhat hard to observe until #8174 is merged, fixing the accidental hiding of experimental features that aren't currently enabled, but the fix is technically orthogonal.No longer true. The #8201 stop-gap also makes it show up, and has been merged.
Checklist for maintainers
Maintainers: tick if completed or explain if not relevant
tests/**.shsrc/*/teststests/nixos/*Priorities
Add 👍 to pull requests you find important.