nix-darwin
nix-darwin copied to clipboard
default redis dataDir is not auto created
If /var/lib/redis
dir does not exist, services.redis.enable = true
would fail silently. It succeeds after /var/lib/redis
created.
❯ /nix/store/hgkxn25dcp03lpxpz138kczw0xyxi3q4-redis-7.0.11/bin/redis-server /etc/redis.conf
*** FATAL CONFIG FILE ERROR (Redis 7.0.11) ***
Reading the configuration file, at line 4
>>> 'dir /var/lib/redis'
No such file or directory
It should either create the directory automatically, or tell user to create it manually.
system.activationScripts.preActivation = {
enable = true;
text = ''
if [ ! -d "/var/lib/redis/" ]; then
echo "creating Redis data directory..."
sudo mkdir -m 750 -p /var/lib/redis/
chown -R ecklf:staff /var/lib/redis/
fi
'';
};
Here is a workaround until fixed.