diff --git a/modules/server/default.nix b/modules/server/default.nix index a2f614a1..9dfed1be 100644 --- a/modules/server/default.nix +++ b/modules/server/default.nix @@ -2,7 +2,7 @@ with lib; let cfg = config.void.server; in { - imports = [ ./dns ./nginx.nix ./services ./postgresql.nix ]; + imports = [ ./dns ./nginx.nix ./services ./postgresql.nix ./redis.nix ]; options.void.server = { isServer = mkEnableOption false; }; diff --git a/modules/server/redis.nix b/modules/server/redis.nix new file mode 100644 index 00000000..e8f73de2 --- /dev/null +++ b/modules/server/redis.nix @@ -0,0 +1,27 @@ +{ 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; + servers = mkIf srv.services.forgejo.enable { + forgejo = { + enable = true; + user = "forgejo"; + port = 6371; + databases = 16; + logLevel = "debug"; + requirePass = "forgejo"; + }; + }; + }; + }; +} +