doc: ensure pkgs is not used in option docs
Providing a stub `pkgs` instance that has no contents ensures the docs does not _read_ `pkgs` anywhere.
This commit is contained in:
parent
07af242a44
commit
e1ae98f979
1 changed files with 14 additions and 1 deletions
|
|
@ -14,11 +14,24 @@ let
|
|||
# Prefix to remove from option declaration file paths.
|
||||
rootPrefix = toString ../. + "/";
|
||||
|
||||
# A stub pkgs used while evaluating the stylix modules for the docs
|
||||
noPkgs = {
|
||||
# Needed for type-checking
|
||||
inherit (pkgs) _type;
|
||||
|
||||
# Permit access to (pkgs.formats.foo { }).type
|
||||
formats = builtins.mapAttrs (_: fmt: args: {
|
||||
inherit (fmt args) type;
|
||||
}) pkgs.formats;
|
||||
};
|
||||
|
||||
evalDocs =
|
||||
module:
|
||||
lib.evalModules {
|
||||
modules = [ ./eval_compat.nix ] ++ lib.toList module;
|
||||
specialArgs = { inherit pkgs; };
|
||||
specialArgs = {
|
||||
pkgs = noPkgs;
|
||||
};
|
||||
};
|
||||
|
||||
# TODO: Include Nix Darwin options
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue