diff --git a/release.nix b/release.nix index 750510dc..2747eb64 100644 --- a/release.nix +++ b/release.nix @@ -121,6 +121,7 @@ let tests.services-ofborg = makeTest ./tests/services-ofborg.nix; tests.services-offlineimap = makeTest ./tests/services-offlineimap.nix; tests.services-privoxy = makeTest ./tests/services-privoxy.nix; + tests.services-redis = makeTest ./tests/services-redis.nix; tests.services-skhd = makeTest ./tests/services-skhd.nix; tests.services-spacebar = makeTest ./tests/services-spacebar.nix; tests.services-synapse-bt = makeTest ./tests/services-synapse-bt.nix; diff --git a/tests/services-redis.nix b/tests/services-redis.nix new file mode 100644 index 00000000..a46916b7 --- /dev/null +++ b/tests/services-redis.nix @@ -0,0 +1,26 @@ +{ 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 + ''; +}