-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
nixos-manual: Include all modules in documentation generation #47177
Conversation
/cc @oxij |
Ah apparently using |
I like the idea, but
- I think you can just add `modules` argument to the top of the whole expression and get the whole list of modules loaded by the current configuration.
- Hence, I expected this to simply add `++ optionals optionName modules` thing after `baseModules`, not to rewrite the whole attribute.
E.g. why did you go from `evalModules` back to `eval-config.nix` and remove all the stuff the old version did with `localSystem`?
|
Just my unfamiliarity. I somehow was convinced that the modules argument was not injected into each module by |
c125e44
to
389494d
Compare
I haved used your suggestions! Seems to build now on CI! |
Previously, `man 5 configuration.nix` would only show options of modules in the `baseModules` set, which consists only of the list of modules in `nixos/modules/module-list.nix` however, with this change, any extra module that is included in your `configuration.nix` file by the means of ``` imports = [ ./rootfs.nix ] ``` will also be included the generated documentation. Example output: ``` OPTIONS You can use the following options in configuration.nix. arian.rootfs.device The device that contains the btrfs volume Type: string Declared by: /home/arian/Projects/nixos-stuff/computers/t430s/rootfs.nix boot.enableContainers Whether to enable support for nixos containers. Type: boolean Default: true Declared by: <nixpkgs/nixos/modules/virtualisation/containers.nix> ``` I found it useful for my machine to be self-documenting. It also means that if you import modules like `gce.nix` or `azure.nix` which aren't in `module-list.nix`, documentation is still generated for these modules cc: NixOS#11499 - [ ] I have no idea if this patch impacts the way the documentation for https://nixos.org/nixos is generated. It might. We should check this. ---
389494d
to
1f6bf40
Compare
Before this change `man 5 configuration.nix` would only show options of modules in the `baseModules` set, which consists only of the list of modules in `nixos/modules/module-list.nix` With this change applied and `documentation.nixos.includeAllModules` option enabled all modules included in `configuration.nix` file will be used instead. This makes configurations with custom modules self-documenting. It also means that importing non-`baseModules` modules like `gce.nix` or `azure.nix` will make their documentation available in `man 5 configuration.nix`. `documentation.nixos.includeAllModules` is currently set to `false` by default as enabling it usually uncovers bugs and prevents evaluation. It should be set to `true` in a release or two. This was originally implemented in NixOS#47177, edited for more configurability, documented and rebased onto master by @oxij.
Previously,
man 5 configuration.nix
would only showoptions of modules in the
baseModules
set, whichconsists only of the list of modules in
nixos/modules/module-list.nix
however, with this change, any extra module that is included
in your
configuration.nix
file by the means ofwill also be included the generated documentation.
Example output:
Motivation for this change
I found it useful for my machine to be self-documenting. It also means
that if you import modules like
gce.nix
orazure.nix
which aren't inmodule-list.nix
, documentation is still generated for these modulescc: #11499
Things to do
is generated. It might. We should check this.