diff options
| author | Robert Hensing <robert@roberthensing.nl> | 2021-12-20 22:49:23 +0100 |
|---|---|---|
| committer | Robert Hensing <robert@roberthensing.nl> | 2022-01-02 12:45:39 +0100 |
| commit | 19a1534e61042d456fb222ea25d3443667aeddab (patch) | |
| tree | 23c449ec76cbd4d303f0c699c5485557f3875663 /modules/documentation | |
| parent | 0937f9c060d5ee36f4033dc5da2c88f802e82e9d (diff) | |
modules/documentation/default.nix: Fix args warning
Diffstat (limited to 'modules/documentation')
| -rw-r--r-- | modules/documentation/default.nix | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/modules/documentation/default.nix b/modules/documentation/default.nix index 34a75ca..6bd3412 100644 --- a/modules/documentation/default.nix +++ b/modules/documentation/default.nix @@ -5,6 +5,17 @@ with lib; let cfg = config.documentation; + # To reference the regular configuration from inside the docs evaluation further down. + # While not strictly necessary, this extra binding avoids accidental name capture in + # the future. + regularConfig = config; + + argsModule = { + config._module.args = regularConfig._module.args // { + modules = [ ]; + }; + }; + /* For the purpose of generating docs, evaluate options with each derivation in `pkgs` (recursively) replaced by a fake with path "\${pkgs.attribute.path}". It isn't perfect, but it seems to cover a vast majority of use cases. @@ -17,8 +28,7 @@ let options = let scrubbedEval = evalModules { - modules = baseModules; - args = (config._module.args) // { modules = [ ]; }; + modules = baseModules ++ [ argsModule ]; specialArgs = { pkgs = scrubDerivations "pkgs" pkgs; }; }; scrubDerivations = namePrefix: pkgSet: mapAttrs |
