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.
This commit is contained in:
parent
2440ea285c
commit
0b5f6200d8
5 changed files with 17 additions and 9 deletions
|
|
@ -172,14 +172,6 @@ in
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
system.activationScripts.symlink-asterisk-sounds-de = lib.stringAfter [ "var" ] ''
|
|
||||||
sounds="/var/lib/asterisk/sounds"
|
|
||||||
sounds_de="$sounds/de"
|
|
||||||
mkdir -p "$sounds"
|
|
||||||
[ -L "$sounds_de" ] && rm "$sounds_de"
|
|
||||||
ln -s "${pkgs.asterisk-sounds-de}/" "$sounds_de"
|
|
||||||
'';
|
|
||||||
|
|
||||||
systemd.services."asterisk-reload-endpoint@" = {
|
systemd.services."asterisk-reload-endpoint@" = {
|
||||||
description = "Check if asterisk endpoint is identified and reload it when it is not.";
|
description = "Check if asterisk endpoint is identified and reload it when it is not.";
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
|
|
|
||||||
15
pkgs/asterisk-sounds-de/module.nix
Normal file
15
pkgs/asterisk-sounds-de/module.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
{ 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"
|
||||||
|
'')
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -6,7 +6,7 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
ariang = callPackage ./ariang { };
|
ariang = callPackage ./ariang { };
|
||||||
asterisk-sounds-de = callPackage ./asterisk/sounds-de.nix { };
|
asterisk-sounds-de = callPackage ./asterisk-sounds-de { };
|
||||||
docker-machine-driver-hetzner = callPackage ./docker-machine-driver-hetzner {
|
docker-machine-driver-hetzner = callPackage ./docker-machine-driver-hetzner {
|
||||||
inherit (inputs.gomod2nix.legacyPackages.${system}) buildGoApplication;
|
inherit (inputs.gomod2nix.legacyPackages.${system}) buildGoApplication;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
./asterisk-sounds-de/module.nix
|
||||||
./myintercom-doorbell/module.nix
|
./myintercom-doorbell/module.nix
|
||||||
./pretix/module.nix
|
./pretix/module.nix
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue