| 27 Mar 2024 |
hexa | yeah, but that's not really discoverable | 23:29:36 |
hexa | * bla = mkOption {
defaultText = ''
Something if cond, else unset
'';
} // lib.optionalAttrs (cond) {
default = "bar";
};
| 23:30:03 |
hexa | update the example with defaultText | 23:30:12 |
Infinidoge | You're already gonna need to use the documentation text override, so I don't think it would really affect the discoverability that much | 23:30:19 |
hexa | that was always going to be the case | 23:30:32 |
hexa | but defaultText makes the condition discoverable | 23:30:39 |
hexa | as opposed to hiding it in the implementation | 23:30:47 |
Infinidoge | My example was just how the default part could be done, wasn't a self-contained example | 23:31:58 |
hexa | I understood config as the implementation section of the module | 23:32:55 |
Infinidoge | It's... weird, unfortunately. Options are mostly the interface, but with defaults they are somewhat load bearing | 23:34:02 |