| 18 Mar 2024 |
| Infinidoge joined the room. | 18:47:27 |
| 19 Mar 2024 |
| NixOS Moderation Botchanged room power levels. | 00:29:53 |
| 21 Mar 2024 |
| NixOS Moderation Botchanged room power levels. | 18:02:50 |
| 22 Mar 2024 |
| chadac joined the room. | 02:03:16 |
| terminalfilth joined the room. | 05:13:35 |
| terminalfilth set a profile picture. | 05:24:39 |
| terminalfilth changed their profile picture. | 05:24:49 |
| 23 Mar 2024 |
| Federico Damián Schonborn joined the room. | 00:37:24 |
| SomeoneSerge (void) changed their display name from SomeoneSerge (hash-versioned python modules when) to SomeoneSerge (migrating synapse). | 02:11:12 |
| 27 Mar 2024 |
hexa | is there a way to set an optional option default? | 23:21:25 |
hexa | default = if foo then "bar" else omit;
| 23:21:46 |
hexa | * default = if foo then "bar" else omit; # if not foo, consider the value unset
| 23:22:21 |
hexa | uhhhhhh | 23:25:58 |
hexa | can I like | 23:26:00 |
hexa | bla = mkOption {
} // lib.optionalAttrs (cond) {
default = "bar";
};
| 23:26:37 |
hexa | probably can | 23:26:51 |
Infinidoge | I think that would work | 23:27:14 |
Infinidoge | Might need parenthesis, but even then | 23:27:23 |
hexa | 🙂 | 23:27:35 |
Infinidoge | If it doesn't work, you can definitely do it through config though | 23:28:44 |
Infinidoge | config.bla = lib.mkIf cond (lib.mkDefault "value");
| 23:29:08 |
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 |