diff options
| author | seth <[email protected]> | 2023-11-30 23:30:00 -0500 |
|---|---|---|
| committer | seth <[email protected]> | 2023-12-01 07:12:49 -0500 |
| commit | 85402f9103b55dff65c6a6079c6902080e5a30a6 (patch) | |
| tree | eba04a9f9938ac1d7ac14cb5d7bc5e0fb8f4db16 /parts/module.nix | |
| parent | 41dfa94258215769b9d844875e79097d4a498770 (diff) | |
feat: add redis for reactboard
Diffstat (limited to 'parts/module.nix')
| -rw-r--r-- | parts/module.nix | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/parts/module.nix b/parts/module.nix index 5c1af12..5048c13 100644 --- a/parts/module.nix +++ b/parts/module.nix @@ -22,6 +22,18 @@ in { options.services.teawiebot = { enable = mkEnableOption "teawiebot"; package = mkPackageOption self.packages.${pkgs.stdenv.hostPlatform.system} "teawiebot" {}; + + redisUrl = mkOption { + description = mdDoc '' + Redis URL for teawieBot + ''; + type = types.str; + default = "unix:${config.services.redis.servers.teawiebot.unixSocket}"; + example = literalExpression '' + "redis://localhost/" + ''; + }; + environmentFile = mkOption { description = mdDoc '' Environment file as defined in {manpage}`systemd.exec(5)` @@ -35,6 +47,8 @@ in { }; config = mkIf cfg.enable { + services.redis.servers.teawiebot.enable = true; + systemd.services."teawiebot" = { enable = true; wantedBy = mkDefault ["multi-user.target"]; @@ -48,6 +62,7 @@ in { Restart = "always"; EnvironmentFile = mkIf (cfg.environmentFile != null) cfg.environmentFile; + Environment = ["REDIS_URL=${cfg.redisUrl}"]; # hardening DynamicUser = true; |
