sergei-mironov / asterisk-dongle-setup

Playground project aimed at setting up Asterisk server and the GSM stack on Nix.
31 stars 4 forks source link

tg2sip-conf Compile Issue #5

Closed AlphaJosh closed 2 years ago

AlphaJosh commented 2 years ago

While compiling tg2sip-conf I get the following error:

admin@srv-Lit-01:/srv/asterisk-dongle-setup$ nix-build -A tg2sip-conf -o result-tg2sip-conf --show-trace
error: 7129136

       … while evaluating the attribute 'text' of the derivation 'settings.ini'

       at /nix/store/in6ppv9g7zzlziw87b7ajwl07pifairi-nixpkgs-22.05pre344305.32356ce11b8/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:205:7:

          204|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          205|       name =
             |       ^
          206|         let

Full verbose output log https://pastebin.com/xQjyvkEd

I dont know this language but looks like the variable is left open

AlphaJosh commented 2 years ago

In the end, I commented out line 21 of ./run.sh

nix-build -A tg2sip-conf -o result-tg2sip-conf

And then manually created the folder 'asterisk-dongle-setup/result-tg2sip-conf/etc' and created the file 'asterisk-dongle-setup/result-tg2sip-conf/etc/settings.ini'

[logging]
core=1
tgvoip=1
pjsip=1
sip_messages=true

[sip]
port=5061
id_uri=sip:127.0.0.1:5060

Not sure if that is correct

sergei-mironov commented 2 years ago

In the end, I commented out line 21 of ./run.sh

nix-build -A tg2sip-conf -o result-tg2sip-conf

And then manually created the folder 'asterisk-dongle-setup/result-tg2sip-conf/etc' and created the file 'asterisk-dongle-setup/result-tg2sip-conf/etc/settings.ini'

[logging]
core=1
tgvoip=1
pjsip=1
sip_messages=true

[sip]
port=5061
id_uri=sip:127.0.0.1:5060

Not sure if that is correct

Hm, that could also work, but the idea of cause is to build the config using Nix and then use ./result-tg2sip-conf/.../settings.ini -> /nix/store/... because in this case it will keep parameters of tg2sip in sync with other parameters. Actually, I can't see the source of the problem right now. The expression is at https://github.com/grwlf/asterisk-dongle-setup/blob/ac3e468afcb6ddda32c0deb48cd65a4043418391/default.nix#L619 and it is basically a call to function which generates the file, given the name and the contents.

My only idea is that since I use with secrets; ... for the "contents" parameter, you can break something by e.g. making a syntax error in your ./secrets.nix , so consider checking it.. And be advised that nix is known for its poor error messages.

sergei-mironov commented 2 years ago

Please reopen this if you have any problems