nixos-config/terranix/servers/config.nix
Ingolf Wagner 973e3b3305
reformat
2021-11-01 19:30:41 +01:00

32 lines
738 B
Nix

{ config, ... }:
let
get = element: object: "\${ ${object."_ref"}.${element} }";
getVariable = name: "\${ var.${name} }";
in
{
hcloud = {
enable = true;
resource.server."tinc_node" = {
name = "tinc-node-nurnberg";
image = "ubuntu-18.04";
server_type = "cx11";
backups = false;
# datacenter = "nbg1-dc3";
location = "nbg1";
labels = { system = "nixos"; };
};
};
output = {
"${config.hcloud.resource.server."tinc_node".name}-ip4_address".value =
get "ipv4_address" config.hcloud.resource.server."tinc_node";
"${config.hcloud.resource.server."tinc_node".name}-ip6_address".value =
get "ipv6_address" config.hcloud.resource.server."tinc_node";
};
}