about summary refs log tree commit diff
path: root/home/modules/misc/neotheme/default.nix
blob: 01c05bb2a071c175a5d0885f402025b01fb2abb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{ lib, pkgs, config, ... }:

with lib;
let cfg = config.neotheme;
in
{
  options.neotheme = {
    name = mkOption {
      type = types.str;
      default = "";
      description = "palette name";
      example = "My Amazing Theme";
    };

    identifier = mkOption {
      type = types.str;
      default = "";
      description = "palette identifier";
      example = "mytheme";
    };

    colors =
      let
        mkColorOption = name: {
          inherit name;
          value = mkOption {
            type = types.strMatching "[a-fA-F0-9]{6}";
            description = "color ${name}.";
          };
        };
      in
      listToAttrs (map mkColorOption [
        "background"
        "foreground"
        "alt0"
        "alt1"
        "color0"
        "color1"
        "color2"
        "color3"
        "color4"
        "color5"
        "color6"
        "color7"
        "bright0"
        "bright1"
        "bright2"
        "bright3"
        "bright4"
        "bright5"
        "bright6"
        "bright7"
      ]);
  };
}