From aea521150d20f81aef9a48cb072981c2a5712252 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 25 Dec 2022 16:45:58 +0300 Subject: [PATCH] nixos/public-inbox: fix incorrectly restrictive option type The `freeformType` of `settings.publicinbox` in this module prevented users from setting settings on the `publicinbox` section itself (which is necessary for making e.g. IMAP work correctly), and only allowed configuration of nested per-inbox sections. In general I believe that these overly specific types which are traditional in NixOS, and this kind of config generation, are a huge footgun. This commit is the least invasive change that makes the module work correctly. --- nixos/modules/services/mail/public-inbox.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/mail/public-inbox.nix b/nixos/modules/services/mail/public-inbox.nix index ab7ff5f726a4..9cd6726e6cb2 100644 --- a/nixos/modules/services/mail/public-inbox.nix +++ b/nixos/modules/services/mail/public-inbox.nix @@ -275,7 +275,11 @@ in default = {}; description = lib.mdDoc "public inboxes"; type = types.submodule { - freeformType = with types; /*inbox name*/attrsOf (/*inbox option name*/attrsOf /*inbox option value*/iniAtom); + # Keeping in line with the tradition of unnecessarily specific types, allow users to set + # freeform settings either globally under the `publicinbox` section, or for specific + # inboxes through additional nesting. + freeformType = with types; attrsOf (oneOf [ iniAtom (attrsOf iniAtom) ]); + options.css = mkOption { type = with types; listOf str; default = [];