nixos-configuration/pkgs/asterisk-sounds-de/module.nix
Jakob Lechner 0b5f6200d8
Fix asterisk-sounds-de
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.
2023-11-08 23:49:53 +00:00

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"
'')
];
};
}