modules/files: don't include modules in the docs

This means we no longer need to spoof the module in the docs implementation.

Instead, we supply the (optional) special arg `isDocs` to `evalModules`.
This commit is contained in:
Matt Sturgeon 2024-07-05 16:39:32 +01:00
parent f5ba05ec82
commit 38d43a740f
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
3 changed files with 26 additions and 35 deletions

View file

@ -3,28 +3,42 @@
config,
lib,
helpers,
specialArgs,
...
}:
let
inherit (lib) types;
isDocs = specialArgs.isDocs or false;
fileModuleType = types.submoduleWith {
shorthandOnlyDefinesConfig = true;
specialArgs = {
inherit helpers;
defaultPkgs = pkgs;
};
modules = [
# Don't include the modules in the docs, as that'd be redundant
modules = lib.optionals (!isDocs) [
../../.
./submodule.nix
];
description = "Nixvim configuration";
};
in
{
options = {
files = lib.mkOption {
type = types.attrsOf fileModuleType;
description = "Files to include in the Vim config.";
description = "Extra files to add to the runtimepath";
default = { };
example = {
"ftplugin/nix.lua" = {
opts = {
tabstop = 2;
shiftwidth = 2;
expandtab = true;
};
};
};
};
filesPlugin = lib.mkOption {