mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-02-24 04:18:03 +00:00
theme/theme.nix: move listToAttrs inheriting, fix base16-colors declaration
This commit is contained in:
parent
423ed4d1d6
commit
266f880561
1 changed files with 13 additions and 13 deletions
|
@ -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;
|
||||||
|
@ -19,16 +18,17 @@
|
||||||
|
|
||||||
numbers = ["0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "A" "B" "C" "D" "E" "F"];
|
numbers = ["0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "A" "B" "C" "D" "E" "F"];
|
||||||
base16Options = listToAttrs (map (n: {
|
base16Options = listToAttrs (map (n: {
|
||||||
name = "base0${n}";
|
name = "base0${n}";
|
||||||
value = mkOption {
|
value = mkOption {
|
||||||
description = "The base0${n} color to use";
|
description = "The base0${n} color to use";
|
||||||
type = hexColor;
|
type = hexColor;
|
||||||
apply = v:
|
apply = v:
|
||||||
if hasPrefix "#" v
|
if hasPrefix "#" v
|
||||||
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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue