From 8a24bf97f879528835d0e2c0ccac04c7b9adc8b4 Mon Sep 17 00:00:00 2001 From: kurogeek Date: Thu, 25 Dec 2025 14:22:04 +0700 Subject: [PATCH] mob next [ci-skip] [ci skip] [skip ci] lastFile:modules/clan/phonebox/default.nix --- modules/clan/phonebox/default.nix | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/modules/clan/phonebox/default.nix b/modules/clan/phonebox/default.nix index 236ca93..dee12ad 100644 --- a/modules/clan/phonebox/default.nix +++ b/modules/clan/phonebox/default.nix @@ -1,7 +1,5 @@ { clanLib, - config, - lib, ... }: { @@ -10,7 +8,7 @@ manifest.description = ""; manifest.categories = [ "System" ]; - roles.default = builtins.break { + roles.default = { interface = { lib, ... }: { @@ -45,14 +43,22 @@ propagatedNativeBuildInputs = [ pkgs.spandsp3 ]; }); + machines = lib.attrNames roles.default.machines; + user = "asterisk"; faxDir = "/run/asterisk/fax"; rtpPortFrom = 10000; rtpPortTo = 20000; ata-interface = settings.ata-ethernet-iface; - contactList = machineName: { - name = "${config.clan.core.vars.generators.phonebox.files.owner-name.value}"; + contactList = builtins.map (machineName: { + name = "${clanLib.getPublicValue { + flake = config.clan.core.settings.directory; + machine = machineName; + generator = "phonebox"; + file = "owner-name"; + default = null; + }}"; number = "${ (clanLib.getPublicValue { flake = config.clan.core.settings.directory; @@ -71,7 +77,7 @@ } ) }"; - }; + }) machines; genServerSIPEndpoint = { hostname, address }: @@ -134,8 +140,8 @@ else throw "clanService/yggdrasil is required"; in - builtins.break { - clan.core.vars.generators.phonebox = { + { + clan.core.vars.generators.phonebox = builtins.break { files = { server-prefix-number.secret = false; ata-local-number.secret = false; @@ -238,7 +244,6 @@ package = lib.mkDefault asterisk; confFiles = let - machines = lib.attrNames roles.default.machines; nodes = builtins.foldl' ( nodes: name: nodes