-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mark experimental configuration settings programmatically #8196
Conversation
09829cb
to
9d58840
Compare
OK Fixed the unit tests. |
doc/manual/utils.nix
Outdated
> **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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -56,6 +56,21 @@ rec { | |||
body = '' | |||
${description} | |||
|
|||
'' + (if experimental-feature != null then '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OT: Which nix.conf?
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/tweag-nix-dev-update-47/27387/1 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/tweag-nix-dev-update-47/27387/1 |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/this-month-in-nix-docs-2-april-2023/27899/1 |
Motivation
Fix #8162
Context
The test is changed to compare
nlohmann::json
values, 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/**.sh
src/*/tests
tests/nixos/*
Priorities
Add 👍 to pull requests you find important.