Home Explore Blog Models CI



nixpkgs

nixos/modules/services/networking/dsnet.md
2b70f73153ab059f71dacb5fa2015b74a7f6f1b2534d4372000000030000037a
# dsnet {#module-services-dsnet}

dsnet is a CLI tool to manage a centralised wireguard server. It allows easy
generation of client configuration, handling key generation, IP allocation etc.

It keeps its own configuration at `/etc/dsnetconfig.json`, which is more of a
database. It contains key material too.

The way this module works is to patch this database with whatever is configured
in the nix service instantiation. This happens automatically when required.

This way it is possible to decide what to let dnset manage and what parts you
want to keep declaratively.

```
services.dsnet = {
  enable = true;
  settings = {
    ExternalHostname = "vpn.example.com";
    Network = "10.171.90.0/24";
    Network6 = "";
    IP = "10.171.90.1";
    IP6 = "";
    DNS = "10.171.90.1";
    Networks = [ "0.0.0.0/0" ];
  };

```


See <https://github.com/naggie/dsnet> for more information.

Chunks
c2d2a91a (1st chunk of `nixos/modules/services/networking/dsnet.md`)
Title: dsnet: Centralized WireGuard Server Management and Nix Integration
Summary
dsnet is a CLI tool designed to manage a centralized WireGuard server, automating tasks like client configuration, key generation, and IP allocation. It stores its configuration and key material in `/etc/dsnetconfig.json`. The Nix module for `dsnet` integrates by automatically patching this database with settings defined in the Nix service, allowing users to declaratively manage parts of the `dsnet` configuration. An example Nix configuration demonstrates how to enable and configure network settings for the service.