From 79dfd9aa295e53773aad45480b44c131da29f35b Mon Sep 17 00:00:00 2001 From: Matthieu Coudron <886074+teto@users.noreply.github.com> Date: Fri, 13 Jun 2025 15:25:19 +0200 Subject: [PATCH] meli: move freeformat settings to example (#7259) these hardcoded freeformat settings dont add anything over the default, worse they generate empty sections which can then clash with user included config (my usecase). It's best to move those to example. --- modules/programs/meli.nix | 77 +++++++---------------- tests/modules/programs/meli/expected.toml | 8 --- 2 files changed, 24 insertions(+), 61 deletions(-) diff --git a/modules/programs/meli.nix b/modules/programs/meli.nix index 3b629cc6e..ab4791b9a 100644 --- a/modules/programs/meli.nix +++ b/modules/programs/meli.nix @@ -84,65 +84,36 @@ in settings = mkOption { type = types.submodule { - freeformType = (pkgs.formats.toml { }).type; - options = { - shortcuts = mkOption { - type = types.submodule { - options = { - general = mkOption { - type = types.attrsOf types.str; - default = { }; - description = "general shortcut configuration"; - example = { - scroll_up = "e"; - scroll_down = "n"; - next_page = "C-d"; - }; - }; - composing = mkOption { - type = types.attrsOf types.str; - default = { }; - description = "composing shortcut configuration"; - example = { - edit = "m"; - scroll_up = "e"; - scroll_down = "n"; - }; - }; - contact-list = mkOption { - type = types.attrsOf types.str; - default = { }; - description = "contact-list shortcut configuration"; - example = { + freeformType = tomlFormat.type; + }; + example = lib.literalExample '' + { + shortcuts = { + contact-list = { create_contact = "c"; edit_contact = "m"; }; - }; - listing = mkOption { - type = types.attrsOf types.str; - default = { }; - description = "general shortcut configuration"; - example = { - new_mail = "t"; - set_seen = "s"; - }; - }; - pager = mkOption { - type = types.attrsOf types.str; - default = { }; - description = "general shortcut configuration"; - example = { + general = { + edit = "m"; + scroll_up = "e"; + scroll_down = "n"; + }; + composing = { + edit = "m"; + scroll_up = "e"; + scroll_down = "n"; + }; + listing = { + new_mail = "t"; + set_seen = "s"; + }; + pager = { scroll_up = "e"; scroll_down = "n"; - }; - }; - }; - }; - default = { }; - description = "Shortcut Settings"; - }; }; - }; + + } + }''; default = { }; description = "Meli Configuration"; }; diff --git a/tests/modules/programs/meli/expected.toml b/tests/modules/programs/meli/expected.toml index e6a55a851..085000b87 100644 --- a/tests/modules/programs/meli/expected.toml +++ b/tests/modules/programs/meli/expected.toml @@ -27,14 +27,6 @@ PRDR = true danger_accept_invalid_certs = false type = "tls" -[shortcuts.composing] - -[shortcuts.contact-list] - [shortcuts.general] scroll_down = "j" scroll_up = "k" - -[shortcuts.listing] - -[shortcuts.pager]