There was a race condition that lead to incorrect user permissions on the sounds directory. The solution to use the preStart script is better and fixes this issue as well.
15 lines
356 B
Nix
15 lines
356 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
let cfg = config;
|
|
in
|
|
{
|
|
config = lib.mkIf cfg.services.asterisk.enable {
|
|
systemd.services.asterisk.preStart = lib.mkMerge [
|
|
(lib.mkAfter ''
|
|
sounds_de="/var/lib/asterisk/sounds/de"
|
|
[ -L "$sounds_de" ] && rm "$sounds_de"
|
|
ln -s "${pkgs.asterisk-sounds-de}/" "$sounds_de"
|
|
'')
|
|
];
|
|
};
|
|
}
|