Skip to content

Commit

Permalink
modules/context: add isTopLevel option
Browse files Browse the repository at this point in the history
  • Loading branch information
MattSturgeon committed Aug 20, 2024
1 parent cb41399 commit c4fcbb0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions modules/misc/context.nix
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
4 changes: 4 additions & 0 deletions modules/top-level/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@
./output.nix
./test.nix
];

config = {
isTopLevel = true;
};
}

0 comments on commit c4fcbb0

Please sign in to comment.