From 5baac9ff2971b9d4502d8402182e070ea6c729b0 Mon Sep 17 00:00:00 2001 From: Natsu Kagami Date: Mon, 17 Oct 2022 14:10:39 +0200 Subject: [PATCH] Add tinc hosts into /etc/hosts --- modules/my-tinc/hosts.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/my-tinc/hosts.nix b/modules/my-tinc/hosts.nix index 72336b0..da75547 100644 --- a/modules/my-tinc/hosts.nix +++ b/modules/my-tinc/hosts.nix @@ -21,5 +21,12 @@ in settings.Ed25519PublicKey = mkIf (host ? "ed25519PublicKey") host.ed25519PublicKey; }) hosts; + + # Add all of them to host + networking.extraHosts = lib.strings.concatStringsSep + "\n" + (lib.attrsets.mapAttrsToList + (name: host: "${host.subnetAddr} ${name}.tinc") + hosts); }; }