-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82915 from Infinisil/fix-infrec-dependent-option-…
…sets Fix dependent option sets
- Loading branch information
Showing
6 changed files
with
43 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ lib, ... }: | ||
|
||
{ | ||
options.set = { | ||
enable = lib.mkOption { | ||
default = false; | ||
example = true; | ||
type = lib.types.bool; | ||
description = '' | ||
Some descriptive text | ||
''; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ lib, ... }: | ||
|
||
{ | ||
options.set = { | ||
value = lib.mkOption { | ||
type = lib.types.ints.positive; | ||
}; | ||
}; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ 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.set = { | ||
value = if options ? set.enable then 360 else 7; | ||
} | ||
# Only define if possible. | ||
// lib.optionalAttrs (options ? set.enable) { | ||
enable = true; | ||
}; | ||
|
||
} |