theme/theme.nix: fix up base16 helper func

Co-authored-by: diniamo <55629891+diniamo@users.noreply.github.com>
This commit is contained in:
Charlie Root 2024-10-05 11:18:17 +00:00 committed by GitHub
parent 49ec0adca3
commit 423ed4d1d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -17,18 +17,18 @@
inherit lib config;
};
numbers = lib.stringToCharacters "0123456789ABCDEF";
generateBase16Options = listToAttrs (map (i: {
name = "base0${i}";
value = mkOption {
type = hexColor;
apply = v:
if hasPrefix "#" v
then v
else "#${v}";
};
})
numbers);
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);
in {
options.vim.theme = {
enable = mkOption {