nixos-config/terranix/servers/config.nix

32 lines
738 B
Nix
Raw Normal View History

2019-12-20 05:54:26 +01:00
{ config, ... }:
2019-10-24 02:20:38 +02:00
let
2019-12-20 05:54:26 +01:00
get = element: object: "\${ ${object."_ref"}.${element} }";
2019-10-24 02:20:38 +02:00
2019-12-20 05:54:26 +01:00
getVariable = name: "\${ var.${name} }";
2019-10-24 02:20:38 +02:00
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";
2019-12-20 05:54:26 +01:00
labels = { system = "nixos"; };
2019-10-24 02:20:38 +02:00
};
};
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";
};
}