modules/context: add isTopLevel option

This commit is contained in:
Matt Sturgeon 2024-07-06 23:06:07 +01:00
parent cb413995e1
commit c4fcbb0dcf
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
2 changed files with 14 additions and 0 deletions

View file

@ -1,6 +1,16 @@
{ lib, ... }:
{
options = {
isTopLevel = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Whether modules are being evaluated at the "top-level".
Should be false when evaluating nested submodules.
'';
internal = true;
visible = false;
};
isDocs = lib.mkOption {
type = lib.types.bool;
default = false;

View file

@ -10,4 +10,8 @@
./output.nix
./test.nix
];
config = {
isTopLevel = true;
};
}