about summary refs log tree commit diff
path: root/home/modules/misc/neotheme/default.nix
blob: df692513bc7a013f4c398783fa6440401e3ce4cd (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
56
57
58
59
60
61
62
{ lib, pkgs, config, ... }:

with lib;
let cfg = config.neotheme;
in
{
  options.neotheme = {
    wallpaper = mkOption {
      type = types.str;
      default = "";
      description = "path for wallpaper image file";
      example = "/weird/dir/wallpaper.png";
    };

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

      name = mkOption {
        type = types.str;
        default = "";
        description = "palette name";
        example = "My Amazing Theme";
      };

      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"
          "color0"
          "color1"
          "color2"
          "color3"
          "color4"
          "color5"
          "color6"
          "color7"
          "bright0"
          "bright1"
          "bright2"
          "bright3"
          "bright4"
          "bright5"
          "bright6"
          "bright7"
        ]);
    };
  };
}