From 67fb3e00a493c68717d25861ab772d47d018b381 Mon Sep 17 00:00:00 2001 From: Charlie Root Date: Wed, 9 Oct 2024 00:17:23 +0200 Subject: [PATCH] theme/supported-themes.nix: use mergeAttrsList to generate options --- modules/plugins/theme/supported-themes.nix | 34 ++++++++++++---------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/modules/plugins/theme/supported-themes.nix b/modules/plugins/theme/supported-themes.nix index 0d42cc1..83e1a8f 100644 --- a/modules/plugins/theme/supported-themes.nix +++ b/modules/plugins/theme/supported-themes.nix @@ -3,7 +3,7 @@ lib, }: let inherit (lib.strings) hasPrefix optionalString; - inherit (lib.attrsets) genAttrs listToAttrs; + inherit (lib.attrsets) genAttrs listToAttrs mergeAttrsList; inherit (lib.options) mkOption mkEnableOption; inherit (lib.types) bool str; inherit (lib.nvim.types) hexColor mkPluginSetupOption; @@ -174,21 +174,23 @@ in { # palette_overrides = mkLuaInline "{}"; # overrides = mkLuaInline "{}"; } - // genAttrs [ - "terminal_colors" - "undercurls" - "underline" - "bold" - "strikethrough" - "inverse" - ] (name: mkEnableOption' name) - // genAttrs [ - "invert_selection" - "invert_signs" - "invert_tabline" - "invert_intend_guides" - "dim_inactive" - ] (name: mkEnableOption name); + // mergeAttrsList [ + (genAttrs [ + "terminal_colors" + "undercurls" + "underline" + "bold" + "strikethrough" + "inverse" + ] (name: mkEnableOption' name)) + (genAttrs [ + "invert_selection" + "invert_signs" + "invert_tabline" + "invert_intend_guides" + "dim_inactive" + ] (name: mkEnableOption name)) + ]; setup = '' -- Gruvbox theme vim.o.background = "${cfg.style}"