From 1c3fd3f47b04e66f9a4744adbab263134f7e4601 Mon Sep 17 00:00:00 2001 From: Natsu Kagami Date: Thu, 28 Oct 2021 17:05:35 -0400 Subject: [PATCH] Make addresses optional --- modules/my-tinc/hosts.nix | 2 +- modules/my-tinc/hosts/default.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/my-tinc/hosts.nix b/modules/my-tinc/hosts.nix index bb9b534..51aa522 100644 --- a/modules/my-tinc/hosts.nix +++ b/modules/my-tinc/hosts.nix @@ -14,7 +14,7 @@ in config = mkIf cfg.enable { # All hosts we know of services.tinc.networks.my-tinc.hostSettings = mapAttrs (name: host: { - addresses = [ { address = host.address; } ]; + addresses = if (host ? address) then [ { address = host.address; } ] else []; subnets = [ { address = host.subnetAddr; } ]; rsaPublicKey = mkIf (host ? "rsaPublicKey") host.rsaPublicKey; settings.Ed25519PublicKey = mkIf (host ? "ed25519PublicKey") host.ed25519PublicKey; diff --git a/modules/my-tinc/hosts/default.nix b/modules/my-tinc/hosts/default.nix index 0cd1f10..4d6d85b 100644 --- a/modules/my-tinc/hosts/default.nix +++ b/modules/my-tinc/hosts/default.nix @@ -10,5 +10,5 @@ subnetAddr = "11.0.0.3"; rsaPublicKey = builtins.readFile ./nki-macbook.pub; ed25519PublicKey = "lkNkBTl5GmcQFrtA7F1nN2gq5gFK7KuGqHUN8fiJU7H"; - } + }; }