aboutsummaryrefslogtreecommitdiff
path: root/nix/deuxfleurs.nix
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-03-31 16:36:48 +0200
committerAlex Auvolat <alex@adnab.me>2023-03-31 16:36:48 +0200
commit2add84963dab019b165d8199b94e790d43d6e0cd (patch)
tree4c3cef1f07752828e4daf0fc2f46ebcddb501270 /nix/deuxfleurs.nix
parenta31c6d109e95a33e165d43c4a47de54ea53ca436 (diff)
downloadnixcfg-wgautomesh-service-v2.tar.gz
nixcfg-wgautomesh-service-v2.zip
use wgautomesh service definition from my nixpkgs PRwgautomesh-service-v2
Diffstat (limited to 'nix/deuxfleurs.nix')
-rw-r--r--nix/deuxfleurs.nix25
1 files changed, 13 insertions, 12 deletions
diff --git a/nix/deuxfleurs.nix b/nix/deuxfleurs.nix
index 7632486..b174b97 100644
--- a/nix/deuxfleurs.nix
+++ b/nix/deuxfleurs.nix
@@ -207,18 +207,19 @@ in
};
services.wgautomesh = {
enable = true;
- interface = "wg0";
- gossipPort = 1666;
- gossipSecretFile = "/var/lib/wgautomesh/gossip_secret";
- persistFile = "/var/lib/wgautomesh/state";
- upnpForwardPublicPort =
- if clusterNodeCfg.endpoint != null then
- strings.toInt (lists.last (split ":" clusterNodeCfg.endpoint))
- else null;
- peers = attrValues (mapAttrs (hostname: { publicKey, endpoint, address, ... }: {
- inherit address endpoint;
- pubkey = publicKey;
- }) cfg.clusterNodes);
+ gossipSecretFile = "/var/lib/deuxfleurs/wgautomesh_gossip_secret";
+ settings = {
+ interface = "wg0";
+ gossip_port = 1666;
+ upnp_forward_external_port =
+ if clusterNodeCfg.endpoint != null then
+ strings.toInt (lists.last (split ":" clusterNodeCfg.endpoint))
+ else null;
+ peers = attrValues (mapAttrs (hostname: { publicKey, endpoint, address, ... }: {
+ inherit address endpoint;
+ pubkey = publicKey;
+ }) cfg.clusterNodes);
+ };
};
# Old code for wg-quick, we can use this as a fallback if we fail to make wgautomesh work
# systemd.services."wg-quick-wg0".after = [ "unbound.service" ];