Hosts setup succeeded

This commit is contained in:
Natsu Kagami 2021-10-28 16:35:02 -04:00
parent 2692265ddd
commit 6eeabbbddf
5 changed files with 57 additions and 12 deletions

View file

@ -14,10 +14,10 @@ in
config = mkIf cfg.enable {
# All hosts we know of
services.tinc.networks.my-tinc.hostSettings = mapAttrs (name: host: {
addresses = [ { inherit (host) address; } ];
addresses = [ { address = host.address; } ];
subnets = [ { address = host.subnetAddr; } ];
rsaPublicKey = mkIf (host ? "rsaPublicKey") (builtins.readFile host.rsaPublicKey);
ed25519PublicKey = mkIf (host ? "ed25519PublicKey") (builtins.readFile host.ed25519PublicKey);
rsaPublicKey = if (host ? "rsaPublicKey") then (builtins.readFile host.rsaPublicKey) else null;
settings.Ed25519PublicKey = mkIf (host ? "ed25519PublicKey") (builtins.readFile host.ed25519PublicKey);
}) hosts;
};
}

View file

@ -1,10 +1,8 @@
{
# TODO: Edit the list of hosts here.
hosts = {
nki-cloud = {
subnetAddr = "10.0.0.10";
address = "nki.personal";
rsaPublicKey = ./nki-cloud.pub;
};
nki-cloud = {
subnetAddr = "10.0.0.10";
address = "nki.personal";
rsaPublicKey = ./nki-cloud.pub;
};
}