Make addresses optional

This commit is contained in:
Natsu Kagami 2021-10-28 17:05:35 -04:00
parent 0ebd6939c6
commit 1c3fd3f47b
2 changed files with 2 additions and 2 deletions

View file

@ -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;

View file

@ -10,5 +10,5 @@
subnetAddr = "11.0.0.3";
rsaPublicKey = builtins.readFile ./nki-macbook.pub;
ed25519PublicKey = "lkNkBTl5GmcQFrtA7F1nN2gq5gFK7KuGqHUN8fiJU7H";
}
};
}