Hey thanks for the response … yes the latter command is what I use and it does work, but rather manual.
According to the nix module though we should be able to setup your command line options with ENV variables, so that they don’t need to be entered on the command line for every device.
I encountered this post, which led me down a rabbit hole, but I eventually found a solution.
The systemd service is created with the environment set as intended. However, the Nix function does not generate the configuration files at /var/lib/netbird-<tunnel name>/config.json; this is handled by the Netbird client. To enable the Netbird CLI to utilize your systemd service, follow these steps:
Modify the configuration at /var/lib/netbird-<tunnel name>/config.json by setting WgIface to <tunnel name> and adding it to the IFaceBlackList.
Execute the CLI with the following command:
netbird --daemon-addr unix:///var/run/netbird-<tunnel name>/sock -c /var/lib/netbird-<tunnel name>/config.json up
This approach ensures that the Netbird CLI operates in conjunction with the systemd service.