forked from DGNum/colmena
ref: reduce eval.nix contract
- documentation contratcts can now bypass the eval.nix iface - enabled by:9bd5e7bb2540664fe1c728c85f80375fe0cbf9fa
This commit is contained in:
parent
b8bdf5824c
commit
c82517fc12
2 changed files with 14 additions and 28 deletions
16
flake.nix
16
flake.nix
|
@ -33,12 +33,24 @@
|
||||||
|
|
||||||
# Full user manual
|
# Full user manual
|
||||||
manual = let
|
manual = let
|
||||||
|
suppressModuleArgsDocs = { lib, ... }: {
|
||||||
|
options = {
|
||||||
|
_module.args = lib.mkOption {
|
||||||
|
internal = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
colmena = self.packages.${system}.colmena;
|
colmena = self.packages.${system}.colmena;
|
||||||
deploymentOptionsMd = (pkgs.nixosOptionsDoc {
|
deploymentOptionsMd = (pkgs.nixosOptionsDoc {
|
||||||
options = evalNix.docs.deploymentOptions pkgs;
|
inherit (pkgs.lib.evalModules {
|
||||||
|
modules = [ colmenaOptions.deploymentOptions suppressModuleArgsDocs];
|
||||||
|
specialArgs = { name = "nixos"; nodes = {}; };
|
||||||
|
}) options;
|
||||||
}).optionsCommonMark;
|
}).optionsCommonMark;
|
||||||
metaOptionsMd = (pkgs.nixosOptionsDoc {
|
metaOptionsMd = (pkgs.nixosOptionsDoc {
|
||||||
options = evalNix.docs.metaOptions pkgs;
|
inherit (pkgs.lib.evalModules {
|
||||||
|
modules = [ colmenaOptions.metaOptions suppressModuleArgsDocs];
|
||||||
|
}) options;
|
||||||
}).optionsCommonMark;
|
}).optionsCommonMark;
|
||||||
in pkgs.callPackage ./manual {
|
in pkgs.callPackage ./manual {
|
||||||
inherit colmena deploymentOptionsMd metaOptionsMd;
|
inherit colmena deploymentOptionsMd metaOptionsMd;
|
||||||
|
|
|
@ -195,14 +195,6 @@ let
|
||||||
nodes = uncheckedNodes;
|
nodes = uncheckedNodes;
|
||||||
};
|
};
|
||||||
|
|
||||||
suppressModuleArgsDocs = { lib, ... }: {
|
|
||||||
options = {
|
|
||||||
_module.args = lib.mkOption {
|
|
||||||
internal = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Add required config Key here since we don't want to eval nixpkgs
|
# Add required config Key here since we don't want to eval nixpkgs
|
||||||
metaConfigKeys = [
|
metaConfigKeys = [
|
||||||
"name" "description"
|
"name" "description"
|
||||||
|
@ -221,22 +213,4 @@ in {
|
||||||
meta = hive.meta;
|
meta = hive.meta;
|
||||||
|
|
||||||
nixosModules = { inherit (colmenaOptions) deploymentOptions; };
|
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;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue