nixos/netbird: add client options for DNS, routing, SSH, rosenpass an… - #487627
nixos/netbird: add client options for DNS, routing, SSH, rosenpass an…#487627shuuri-labs wants to merge 2 commits into
Conversation
7191262 to
fd9865c
Compare
|
Most of what this PR does seems to go against https://github.com/NixOS/rfcs/blob/master/rfcs/0042-config-option.md . Having these options just adds more maintenance burden onto the module, while also somewhat limiting it. I think the reasonable thing to do, would instead be to explain better how In theory the module (the one currently merged into nixpkgs), could also make use of deprecating some of the options, as they don't make any sense to include in the module. |
5d7913f to
3f359f9
Compare
|
@eyJhb thanks for taking a look at this + directing me to RFC 0042. The convention makes sense to me and definitely seems more "nix-y" than what I had done before. In this latest version I've removed all the typed options and instead added:
Also realized I forgot to set myself as the maintainer for this module (whoops), so I've done that too. |
Instead of adding individual typed options for every upstream setting (which goes against RFC 0042), add an extraEnvironment escape hatch and document how to use NB_* environment variables and the config option for full client configuration.
3f359f9 to
c393335
Compare
| on demand, for example to connect to work-related or otherwise conflicting network only when required. | ||
| See the option description for more information. | ||
|
|
||
| [environment](#opt-services.netbird.clients._name_.environment) allows you to pass additional configurations |
There was a problem hiding this comment.
Why has been this setting removed from the docs?
| { | ||
| services.netbird.clients.work = { | ||
| port = 51820; | ||
| extraEnvironment = { |
There was a problem hiding this comment.
Again, why do we need extraEnvironment? All the examples now are with extraEnvironment instead of environment. I still don't get why is extraEnvironment introduced 🤔 Could you expand and show examples comparing against environment?
|
For reference shuuri-labs @ #487367 (comment):
|
…d connection
Motivation
The NetBird client module currently requires users to manually set NB_* environment variables via the environment option to configure features like DNS, routing, SSH, Rosenpass, and self-hosted server URLs. However, environment uses NixOS module merging, which rejects conflicts with module-computed keys (like NB_STATE_DIR), making it awkward to use as an escape hatch.
Rather than adding individual typed options for every upstream setting (which RFC 0042 recommends against) this adds a proper extraEnvironment escape hatch and documents how to use it alongside the existing config option.
Changes
How to test
nix build .#checks.x86_64-linux.nixosTests.netbird -LThings done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.