···189checkConfigOutput true config.enable ./define-option-dependently.nix ./declare-enable.nix ./declare-int-positive-value.nix
190checkConfigOutput 360 config.value ./define-option-dependently.nix ./declare-enable.nix ./declare-int-positive-value.nix
191checkConfigOutput 7 config.value ./define-option-dependently.nix ./declare-int-positive-value.nix
000192193# Check attrsOf and lazyAttrsOf. Only lazyAttrsOf should be lazy, and only
194# attrsOf should work with conditional definitions
···189checkConfigOutput true config.enable ./define-option-dependently.nix ./declare-enable.nix ./declare-int-positive-value.nix
190checkConfigOutput 360 config.value ./define-option-dependently.nix ./declare-enable.nix ./declare-int-positive-value.nix
191checkConfigOutput 7 config.value ./define-option-dependently.nix ./declare-int-positive-value.nix
192+checkConfigOutput true config.set.enable ./define-option-dependently-nested.nix ./declare-enable-nested.nix ./declare-int-positive-value-nested.nix
193+checkConfigOutput 360 config.set.value ./define-option-dependently-nested.nix ./declare-enable-nested.nix ./declare-int-positive-value-nested.nix
194+checkConfigOutput 7 config.set.value ./define-option-dependently-nested.nix ./declare-int-positive-value-nested.nix
195196# Check attrsOf and lazyAttrsOf. Only lazyAttrsOf should be lazy, and only
197# attrsOf should work with conditional definitions
···1+{ lib, options, ... }:
2+3+# Some modules may be distributed separately and need to adapt to other modules
4+# that are distributed and versioned separately.
5+{
6+7+ # Always defined, but the value depends on the presence of an option.
8+ config.set = {
9+ value = if options ? set.enable then 360 else 7;
10+ }
11+ # Only define if possible.
12+ // lib.optionalAttrs (options ? set.enable) {
13+ enable = true;
14+ };
15+16+}