tv ejabberd: sudo -u ejabberd ejabberdctl

This commit is contained in:
tv 2017-10-03 23:58:25 +02:00
parent 7e5bfd450f
commit 0b7a415231

View File

@ -72,7 +72,21 @@ in {
}; };
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
environment.systemPackages = [ cfg.pkgs.ejabberd ]; environment.systemPackages = [
(pkgs.symlinkJoin {
name = "ejabberd-sudo-wrapper";
paths = [
(pkgs.writeDashBin "ejabberdctl" ''
set -efu
cd ${shell.escape cfg.user.home}
exec /run/wrappers/bin/sudo \
-u ${shell.escape cfg.user.name} \
${cfg.pkgs.ejabberd}/bin/ejabberdctl "$@"
'')
cfg.pkgs.ejabberd
];
})
];
krebs.secret.files = { krebs.secret.files = {
ejabberd-certfile = cfg.certfile; ejabberd-certfile = cfg.certfile;