at 23.11-pre 1.4 kB view raw
1{ libPath 2, pkgsLibPath 3, nixosPath 4, modules 5, stateVersion 6, release 7}: 8 9let 10 lib = import libPath; 11 modulesPath = "${nixosPath}/modules"; 12 # dummy pkgs set that contains no packages, only `pkgs.lib` from the full set. 13 # not having `pkgs.lib` causes all users of `pkgs.formats` to fail. 14 pkgs = import pkgsLibPath { 15 inherit lib; 16 pkgs = null; 17 }; 18 utils = import "${nixosPath}/lib/utils.nix" { 19 inherit config lib; 20 pkgs = null; 21 }; 22 # this is used both as a module and as specialArgs. 23 # as a module it sets the _module special values, as specialArgs it makes `config` 24 # unusable. this causes documentation attributes depending on `config` to fail. 25 config = { 26 _module.check = false; 27 _module.args = {}; 28 system.stateVersion = stateVersion; 29 }; 30 eval = lib.evalModules { 31 modules = (map (m: "${modulesPath}/${m}") modules) ++ [ 32 config 33 ]; 34 specialArgs = { 35 inherit config pkgs utils; 36 class = "nixos"; 37 }; 38 }; 39 docs = import "${nixosPath}/doc/manual" { 40 pkgs = pkgs // { 41 inherit lib; 42 # duplicate of the declaration in all-packages.nix 43 buildPackages.nixosOptionsDoc = attrs: 44 (import "${nixosPath}/lib/make-options-doc") 45 ({ inherit pkgs lib; } // attrs); 46 }; 47 config = config.config; 48 options = eval.options; 49 version = release; 50 revision = "release-${release}"; 51 prefix = modulesPath; 52 }; 53in 54 docs.optionsNix