docs: eval modules without access to pkgs

Replace the `package-options` test with a stricter implementation.

When evaluating modules for use in the docs, provide them with a stubbed
`pkgs` instance that throws an error whenever a package is evaluated.

This ensures we don't accidentally use any packages in defaults or
examples.
This commit is contained in:
Matt Sturgeon 2025-01-24 21:22:01 +00:00
parent 0b4a4e8327
commit d7df583211
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
3 changed files with 51 additions and 96 deletions

View file

@ -44,7 +44,6 @@ in
nixpkgs-module = callTest ./nixpkgs-module.nix { };
plugins-by-name = callTest ./plugins-by-name.nix { };
generated = callTest ./generated.nix { };
package-options = callTest ./package-options.nix { };
lsp-all-servers = callTest ./lsp-servers.nix { };
}
# Expose some tests from the docs as flake-checks too