2024-10-11 23:27:07 +03:00
|
|
|
{
|
2024-11-04 04:37:29 +03:00
|
|
|
config,
|
|
|
|
container,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
cfg = config.container.module.redis;
|
|
|
|
in {
|
|
|
|
options.container.module.redis = {
|
|
|
|
enable = lib.mkEnableOption "the Redis server.";
|
|
|
|
address = lib.mkOption {
|
|
|
|
default = "10.1.0.38";
|
|
|
|
type = lib.types.str;
|
|
|
|
};
|
|
|
|
port = lib.mkOption {
|
|
|
|
default = 6379;
|
|
|
|
type = lib.types.int;
|
|
|
|
};
|
|
|
|
};
|
2024-06-25 04:04:39 +03:00
|
|
|
|
2024-11-04 04:37:29 +03:00
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
containers.redis = container.mkContainer cfg {
|
|
|
|
config = { ... }: container.mkContainerConfig cfg {
|
|
|
|
services.redis.servers.main = {
|
|
|
|
enable = true;
|
|
|
|
port = cfg.port;
|
|
|
|
bind = cfg.address;
|
|
|
|
extraParams = [
|
|
|
|
"--protected-mode no"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2024-06-09 23:35:53 +03:00
|
|
|
}
|