theme/theme.nix: move listToAttrs inheriting, fix base16-colors declaration

This commit is contained in:
Charlie Root 2024-10-05 14:55:19 +02:00
parent 423ed4d1d6
commit 266f880561
No known key found for this signature in database

View file

@ -3,9 +3,8 @@
lib, lib,
... ...
}: let }: let
inherit (builtins) listToAttrs;
inherit (lib.options) mkOption; inherit (lib.options) mkOption;
inherit (lib.attrsets) attrNames; inherit (lib.attrsets) attrNames listToAttrs;
inherit (lib.strings) hasPrefix; inherit (lib.strings) hasPrefix;
inherit (lib.types) bool lines enum; inherit (lib.types) bool lines enum;
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
@ -28,7 +27,8 @@
then v then v
else "#${v}"; else "#${v}";
}; };
}) numbers); })
numbers);
in { in {
options.vim.theme = { options.vim.theme = {
enable = mkOption { enable = mkOption {
@ -39,7 +39,7 @@ in {
type = enum (attrNames supportedThemes); type = enum (attrNames supportedThemes);
description = "Supported themes can be found in `supportedThemes.nix`"; description = "Supported themes can be found in `supportedThemes.nix`";
}; };
base16-colors = generateBase16Options; base16-colors = base16Options;
style = mkOption { style = mkOption {
type = enum supportedThemes.${cfg.name}.styles; type = enum supportedThemes.${cfg.name}.styles;