summary refs log blame commit diff
path: root/lib/tests/modules/define-option-dependently.nix
blob: ad85f99a919fc9e6090e33d8fb2892ac2cf9a554 (plain) (tree)
1
2
3
4
5
6
7
8
9








                                                                               
   





                                           
{ lib, options, ... }:

# Some modules may be distributed separately and need to adapt to other modules
# that are distributed and versioned separately.
{

  # Always defined, but the value depends on the presence of an option.
  config = {
    value = if options ? enable then 360 else 7;
  }
  # Only define if possible.
  // lib.optionalAttrs (options ? enable) {
    enable = true;
  };

}