56 lines
1.5 kB
1
{ config, lib, pkgs, ... }:
2
3
let cfg = config.programs.moonlight-mod;
4
in {
5
options.programs.moonlight-mod = {
6
enable = lib.mkEnableOption "Yet another Discord mod";
7
8
configs = let
9
# TODO: type this
10
type = lib.types.nullOr (lib.types.attrs);
11
default = null;
12
in {
13
stable = lib.mkOption {
14
inherit type default;
15
description = "Configuration for Discord Stable";
16
};
17
18
ptb = lib.mkOption {
19
inherit type default;
20
description = "Configuration for Discord PTB";
21
};
22
23
canary = lib.mkOption {
24
inherit type default;
25
description = "Configuration for Discord Canary";
26
};
27
28
development = lib.mkOption {
29
inherit type default;
30
description = "Configuration for Discord Development";
31
};
32
};
33
};
34
35
config = lib.mkIf cfg.enable {
36
xdg.configFile."moonlight-mod/stable.json" =
37
lib.mkIf (cfg.configs.stable != null) {
38
text = builtins.toJSON cfg.configs.stable;
39
};
40
41
xdg.configFile."moonlight-mod/ptb.json" =
42
lib.mkIf (cfg.configs.ptb != null) {
43
text = builtins.toJSON cfg.configs.ptb;
44
};
45
46
xdg.configFile."moonlight-mod/canary.json" =
47
lib.mkIf (cfg.configs.canary != null) {
48
text = builtins.toJSON cfg.configs.canary;
49
};
50
51
xdg.configFile."moonlight-mod/development.json" =
52
lib.mkIf (cfg.configs.development != null) {
53
text = builtins.toJSON cfg.configs.development;
54
};
55
};
56
}
57