Merge pull request #269908 from pbsds/fix-ejabberd-1700922829

nixos/ejabberd: ensure erlang cookie is made
This commit is contained in:
Peder Bergebakken Sundt 2023-12-07 10:18:37 +01:00 committed by GitHub
commit 7a8ee53fdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -120,6 +120,12 @@ in {
if [ -z "$(ls -A '${cfg.spoolDir}')" ]; then
touch "${cfg.spoolDir}/.firstRun"
fi
if ! test -e ${cfg.spoolDir}/.erlang.cookie; then
touch ${cfg.spoolDir}/.erlang.cookie
chmod 600 ${cfg.spoolDir}/.erlang.cookie
dd if=/dev/random bs=16 count=1 | base64 > ${cfg.spoolDir}/.erlang.cookie
fi
'';
postStart = ''