NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.65k stars 13.8k forks source link

`disabledModules` usage can cause NixOS manual build failures in combination with `documentation.nixos.includeAllModules` #90124

Closed Shados closed 1 year ago

Shados commented 4 years ago

Describe the bug disabledModules usage can cause NixOS manual build failures in combination with documentation.nixos.includeAllModules being enabled.

To Reproduce Steps to reproduce the behavior:

  1. Use disabledModules to disable a module that is referenced by one of the hand-written portions of the NixOS manual (like the release notes). Example: disabledModules = [ "services/networking/dnscrypt-proxy2.nix" ];, which has references to its options from nixos/doc/manual/release-notes/rl-2003.xml.
  2. Set documentation.nixos.includeAllModules = true.
  3. Do a nixos-rebuild, watch it fail to build the NixOS manual due to a dangling reference.

Expected behavior Personally, I find having my local modules included in locally built versions of the manual more useful than having links/references to modules from hand-written portions of the manual, so I'd expect the build to succeed (possibly with a warning about missing references).

On the flip side, I can see this is very much an edge case, and other people may prefer the current behaviour. Although it will likely mean incidental manual breakages down the line when module options change without the hand-written portions of the manual altering to match.

Notify maintainers @Infinisil ?

Metadata

 - system: `"x86_64-linux"`
 - host os: `Linux 5.6.4, NixOS, 20.09.git.ef2e20ad3e7 (Nightingale)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.6`
 - channels(shados): `"home-manager, nixos-1903-19.03.173684.c8db7a8a16e"`
 - channels(root): `"nixos-20.09pre228622.029a5de0839"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
infinisil commented 4 years ago

Interesting, so this happens because: By including all modules for the manual, you're also including the configuration.nix where you have the disabledModules, which means it won't be available for the manual build.

I think the best solution would be to provide an option for toggling validity checks, enabled by default.

stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info

Shados commented 3 years ago

Still matters to me.

stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info

Shados commented 3 years ago

Still matters to me.

aviallon commented 1 year ago

@Shados is it still an issue?

Shados commented 1 year ago

I just checked, and: nope (or at least not for the case I ran into the issue in), it appears this was resolved at some point.