mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-14 11:57:34 +00:00
26 lines
761 B
Nix
26 lines
761 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
redis = pkgs.runCommand "redis-0.0.0" {} "mkdir $out";
|
|
in
|
|
|
|
{
|
|
services.redis.enable = true;
|
|
services.redis.package = redis;
|
|
services.redis.extraConfig = ''
|
|
maxmemory-policy allkeys-lru
|
|
stop-writes-on-bgsave-error no
|
|
'';
|
|
|
|
test = ''
|
|
echo >&2 "checking redis service in ~/Library/LaunchAgents"
|
|
grep "org.nixos.redis" ${config.out}/user/Library/LaunchAgents/org.nixos.redis.plist
|
|
grep "${redis}/bin/redis-server /etc/redis.conf" ${config.out}/user/Library/LaunchAgents/org.nixos.redis.plist
|
|
|
|
echo >&2 "checking config in /etc/redis.conf"
|
|
grep "maxmemory-policy allkeys-lru" ${config.out}/etc/redis.conf
|
|
grep "stop-writes-on-bgsave-error no" ${config.out}/etc/redis.conf
|
|
'';
|
|
}
|