blob: 166407e9377a3c1a83220a124805afc6e5c5e620 (
plain) (
blame)
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
|
{
config,
lib,
this,
...
}:
with lib; let
cfg = config.nixfiles.modules.redis;
in {
options.nixfiles.modules.redis.enable = mkEnableOption "Redis";
config = mkIf cfg.enable {
services = {
redis = {
servers.default = {
enable = true;
bind = "127.0.0.1";
port = 6379;
};
vmOverCommit = true;
};
prometheus.exporters = {
redis = {
enable = true;
listenAddress = mkDefault this.wireguard.ipv4.address;
port = mkDefault 9121;
extraFlags = with config.services.redis.servers.default; [
"--redis.addr=redis://${bind}:${toString port}"
"--redis.user=${user}"
];
};
};
};
};
}
|