docs: Add wrapper specific options (#1009)

(Fixes #1002)
This commit is contained in:
traxys 2024-02-03 17:45:53 +01:00 committed by GitHub
parent c10e73fb65
commit ca30f8ddac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -83,6 +83,7 @@
"intBetween" "intBetween"
"nullType" "nullType"
"nonEmptyStr" "nonEmptyStr"
"nixvim-configuration"
] (_: {}); ] (_: {});
in in
# For recursive types avoid calculating sub options, else this # For recursive types avoid calculating sub options, else this
@ -241,15 +242,45 @@
echo "file json $dst/options.json" >> $out/nix-support/hydra-build-products echo "file json $dst/options.json" >> $out/nix-support/hydra-build-products
echo "file json-br $dst/options.json.br" >> $out/nix-support/hydra-build-products echo "file json-br $dst/options.json.br" >> $out/nix-support/hydra-build-products
''; '';
nixvmConfigType = lib.mkOptionType {
name = "nixvim-configuration";
description = "nixvim configuration options";
descriptionClass = "noun";
# Evaluation is irrelevant, only used for documentation.
};
topLevelModules =
[
../wrappers/modules/output.nix
# Fake module to avoid a duplicated documentation
(lib.setDefaultModuleLocation "${nixvimPath}/wrappers/modules/files.nix" {
options.files = lib.mkOption {
type = lib.types.attrsOf nixvmConfigType;
description = "Extra files to add to the runtimepath";
example = {
"ftplugin/nix.lua" = {
options = {
tabstop = 2;
shiftwidth = 2;
expandtab = true;
};
};
};
};
})
]
++ modules;
in in
rec { rec {
options-json = mkOptionsJSON (lib.evalModules {inherit modules;}).options; options-json = mkOptionsJSON (lib.evalModules {modules = topLevelModules;}).options;
man-docs = pkgs.callPackage ./man {inherit options-json;}; man-docs = pkgs.callPackage ./man {inherit options-json;};
} }
# Do not check if documentation builds fine on darwin as it fails: # Do not check if documentation builds fine on darwin as it fails:
# > sandbox-exec: pattern serialization length 69298 exceeds maximum (65535) # > sandbox-exec: pattern serialization length 69298 exceeds maximum (65535)
// lib.optionalAttrs (!pkgs.stdenv.isDarwin) { // lib.optionalAttrs (!pkgs.stdenv.isDarwin) {
docs = pkgs.callPackage ./mdbook { docs = pkgs.callPackage ./mdbook {
inherit mkOptionsJSON modules getSubOptions'; inherit mkOptionsJSON getSubOptions';
modules = topLevelModules;
}; };
} }