-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
make-options-doc: fix string context issues #73966
Conversation
When using `documentation.nixos.includeAllModules = true;` with external modules, the string context might contain dependencies to derivations and so `toFile` refuses to evaluate; ``` error: in 'toFile': the file 'options.xml' cannot refer to derivation outputs, at [...]/nixpkgs/nixos/lib/make-options-doc/default.nix:89:16 ``` This is not an issue when using `writeText` (instead of manually stripping the context).
iirc this will fail regardless, there should be no /nix/store paths in the manual (there's a check for that). |
@domenkozar: I don't know those parts too well yet, but saw the check. The check emits a better error message in comparison to the Maybe it would also make sense to include some additional pointers of how to go about it - or some type of flag to ignore if it's just for local use in the manpage. Otoh, in general it seems to me like It greatly reduces usefulness if one would have to go and fix upstream modules from repos like home-manager, just to have the options being shown in the manpage. What do you think? |
I agree about the error. |
This change causes a giant |
+1 and add a comment. |
Motivation for this change
When using
documentation.nixos.includeAllModules = true;
with externalmodules, the string context might contain dependencies to derivations
and so
toFile
refuses to evaluate;This is not an issue when using
writeText
(instead of manuallystripping the context).
Possibly addresses: #73743
For my particular configuration utilizing home-manager this fix is insufficient, because some of the formatting for some home-manager options fail validation;
But maybe this is one step forward anyways.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @domenkozar