theme/supported-themes.nix: use mergeAttrsList to generate options

This commit is contained in:
Charlie Root 2024-10-09 00:17:23 +02:00
parent e9f9353c45
commit 67fb3e00a4
No known key found for this signature in database

View file

@ -3,7 +3,7 @@
lib, lib,
}: let }: let
inherit (lib.strings) hasPrefix optionalString; inherit (lib.strings) hasPrefix optionalString;
inherit (lib.attrsets) genAttrs listToAttrs; inherit (lib.attrsets) genAttrs listToAttrs mergeAttrsList;
inherit (lib.options) mkOption mkEnableOption; inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) bool str; inherit (lib.types) bool str;
inherit (lib.nvim.types) hexColor mkPluginSetupOption; inherit (lib.nvim.types) hexColor mkPluginSetupOption;
@ -174,21 +174,23 @@ in {
# palette_overrides = mkLuaInline "{}"; # palette_overrides = mkLuaInline "{}";
# overrides = mkLuaInline "{}"; # overrides = mkLuaInline "{}";
} }
// genAttrs [ // mergeAttrsList [
(genAttrs [
"terminal_colors" "terminal_colors"
"undercurls" "undercurls"
"underline" "underline"
"bold" "bold"
"strikethrough" "strikethrough"
"inverse" "inverse"
] (name: mkEnableOption' name) ] (name: mkEnableOption' name))
// genAttrs [ (genAttrs [
"invert_selection" "invert_selection"
"invert_signs" "invert_signs"
"invert_tabline" "invert_tabline"
"invert_intend_guides" "invert_intend_guides"
"dim_inactive" "dim_inactive"
] (name: mkEnableOption name); ] (name: mkEnableOption name))
];
setup = '' setup = ''
-- Gruvbox theme -- Gruvbox theme
vim.o.background = "${cfg.style}" vim.o.background = "${cfg.style}"