nixos/modules/server/redis.nix

36 lines
860 B
Nix
Raw Normal View History

2025-01-01 14:29:01 +04:00
{ config, lib, pkgs, ... }:
let
inherit (lib) mkIf mkEnableOption;
cfg = config.void.server.redis;
srv = config.void.server;
in {
options.void.server.redis = { enable = mkEnableOption false; };
config = mkIf cfg.enable {
# Thank you NotAShelf (again lmao)
services.redis = {
enable = true;
vmOverCommit = true;
2025-01-03 22:15:17 +04:00
servers = {
forgejo = mkIf srv.services.forgejo.enable {
2025-01-01 14:29:01 +04:00
enable = true;
user = "forgejo";
port = 6371;
databases = 16;
logLevel = "debug";
requirePass = "forgejo";
};
2025-01-03 22:15:17 +04:00
nextcloud = mkIf srv.services.local.nextcloud.enable {
enable = true;
user = "nextcloud";
2025-01-03 22:20:09 +04:00
port = 6372;
2025-01-03 22:15:17 +04:00
databases = 16;
logLevel = "debug";
requirePass = "nextcloud";
};
2025-01-01 14:29:01 +04:00
};
};
};
}