nixos/documentation: Use new extendModules instead of legacy args
This commit is contained in:
parent
0b5aea2b27
commit
1a223857ab
|
@ -1,4 +1,4 @@
|
||||||
{ config, lib, pkgs, baseModules, extraModules, modules, modulesPath, ... }:
|
{ config, lib, pkgs, extendModules, noUserModules, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -6,11 +6,8 @@ let
|
||||||
|
|
||||||
cfg = config.documentation;
|
cfg = config.documentation;
|
||||||
|
|
||||||
manualModules =
|
/* Modules for which to show options even when not imported. */
|
||||||
baseModules
|
extraDocModules = [ ../virtualisation/qemu-vm.nix ];
|
||||||
# Modules for which to show options even when not imported
|
|
||||||
++ [ ../virtualisation/qemu-vm.nix ]
|
|
||||||
++ optionals cfg.nixos.includeAllModules (extraModules ++ modules);
|
|
||||||
|
|
||||||
/* For the purpose of generating docs, evaluate options with each derivation
|
/* For the purpose of generating docs, evaluate options with each derivation
|
||||||
in `pkgs` (recursively) replaced by a fake with path "\${pkgs.attribute.path}".
|
in `pkgs` (recursively) replaced by a fake with path "\${pkgs.attribute.path}".
|
||||||
|
@ -24,13 +21,10 @@ let
|
||||||
extraSources = cfg.nixos.extraModuleSources;
|
extraSources = cfg.nixos.extraModuleSources;
|
||||||
options =
|
options =
|
||||||
let
|
let
|
||||||
scrubbedEval = evalModules {
|
extendNixOS = if cfg.nixos.includeAllModules then extendModules else noUserModules.extendModules;
|
||||||
modules = [ { nixpkgs.localSystem = config.nixpkgs.localSystem; } ] ++ manualModules;
|
scrubbedEval = extendNixOS {
|
||||||
args = (config._module.args) // { modules = [ ]; };
|
modules = extraDocModules;
|
||||||
specialArgs = {
|
specialArgs.pkgs = scrubDerivations "pkgs" pkgs;
|
||||||
pkgs = scrubDerivations "pkgs" pkgs;
|
|
||||||
inherit modulesPath;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
scrubDerivations = namePrefix: pkgSet: mapAttrs
|
scrubDerivations = namePrefix: pkgSet: mapAttrs
|
||||||
(name: value:
|
(name: value:
|
||||||
|
|
Loading…
Reference in a new issue