ref: reduce eval.nix contract

- documentation contratcts can now bypass the eval.nix iface
- enabled by:9bd5e7bb2540664fe1c728c85f80375fe0cbf9fa
This commit is contained in:
David Arnold 2022-07-09 15:41:15 -05:00
parent b8bdf5824c
commit c82517fc12
No known key found for this signature in database
GPG key ID: 0318D822BAC965CC
2 changed files with 14 additions and 28 deletions

View file

@ -33,12 +33,24 @@
# Full user manual
manual = let
suppressModuleArgsDocs = { lib, ... }: {
options = {
_module.args = lib.mkOption {
internal = true;
};
};
};
colmena = self.packages.${system}.colmena;
deploymentOptionsMd = (pkgs.nixosOptionsDoc {
options = evalNix.docs.deploymentOptions pkgs;
inherit (pkgs.lib.evalModules {
modules = [ colmenaOptions.deploymentOptions suppressModuleArgsDocs];
specialArgs = { name = "nixos"; nodes = {}; };
}) options;
}).optionsCommonMark;
metaOptionsMd = (pkgs.nixosOptionsDoc {
options = evalNix.docs.metaOptions pkgs;
inherit (pkgs.lib.evalModules {
modules = [ colmenaOptions.metaOptions suppressModuleArgsDocs];
}) options;
}).optionsCommonMark;
in pkgs.callPackage ./manual {
inherit colmena deploymentOptionsMd metaOptionsMd;

View file

@ -195,14 +195,6 @@ let
nodes = uncheckedNodes;
};
suppressModuleArgsDocs = { lib, ... }: {
options = {
_module.args = lib.mkOption {
internal = true;
};
};
};
# Add required config Key here since we don't want to eval nixpkgs
metaConfigKeys = [
"name" "description"
@ -221,22 +213,4 @@ in {
meta = hive.meta;
nixosModules = { inherit (colmenaOptions) deploymentOptions; };
docs = {
deploymentOptions = pkgs: let
eval = pkgs.lib.evalModules {
modules = [ colmenaOptions.deploymentOptions suppressModuleArgsDocs ];
specialArgs = {
name = "nixos";
nodes = {};
};
};
in eval.options;
metaOptions = pkgs: let
eval = pkgs.lib.evalModules {
modules = [ colmenaOptions.metaOptions suppressModuleArgsDocs ];
};
in eval.options;
};
}