From 266f880561e9e68139867632d4a6f9eaa022cc89 Mon Sep 17 00:00:00 2001 From: Charlie Root Date: Sat, 5 Oct 2024 14:55:19 +0200 Subject: [PATCH] theme/theme.nix: move listToAttrs inheriting, fix base16-colors declaration --- modules/plugins/theme/theme.nix | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/modules/plugins/theme/theme.nix b/modules/plugins/theme/theme.nix index 72a006d3..da590a3a 100644 --- a/modules/plugins/theme/theme.nix +++ b/modules/plugins/theme/theme.nix @@ -3,9 +3,8 @@ lib, ... }: let - inherit (builtins) listToAttrs; inherit (lib.options) mkOption; - inherit (lib.attrsets) attrNames; + inherit (lib.attrsets) attrNames listToAttrs; inherit (lib.strings) hasPrefix; inherit (lib.types) bool lines enum; inherit (lib.modules) mkIf; @@ -19,16 +18,17 @@ numbers = ["0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "A" "B" "C" "D" "E" "F"]; base16Options = listToAttrs (map (n: { - name = "base0${n}"; - value = mkOption { - description = "The base0${n} color to use"; - type = hexColor; - apply = v: - if hasPrefix "#" v - then v - else "#${v}"; - }; - }) numbers); + name = "base0${n}"; + value = mkOption { + description = "The base0${n} color to use"; + type = hexColor; + apply = v: + if hasPrefix "#" v + then v + else "#${v}"; + }; + }) + numbers); in { options.vim.theme = { enable = mkOption { @@ -39,7 +39,7 @@ in { type = enum (attrNames supportedThemes); description = "Supported themes can be found in `supportedThemes.nix`"; }; - base16-colors = generateBase16Options; + base16-colors = base16Options; style = mkOption { type = enum supportedThemes.${cfg.name}.styles;