services-flake/nix/redis_test.nix
Shivaraj B H 72a3eaacc8
Process as test (VM -> Native test) (#38)
Co-authored-by: Sridhar Ratnakumar <3998+srid@users.noreply.github.com>
2023-08-23 22:47:20 +05:30

19 lines
435 B
Nix

{ pkgs, config, ... }: {
services.redis."redis1".enable = true;
settings.processes.test =
let
cfg = config.services.redis."redis1";
in
{
command = pkgs.writeShellApplication {
runtimeInputs = [ cfg.package pkgs.gnugrep ];
text = ''
redis-cli ping | grep -q "PONG"
'';
name = "redis-test";
};
depends_on."redis1".condition = "process_healthy";
};
}