From 9c55c0a3cc1af707a91831d3bb66630afa2abda0 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 28 Jul 2017 21:26:31 +0200 Subject: tv cd: use host's ip4 addr --- tv/1systems/cd/config.nix | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'tv/1systems/cd') diff --git a/tv/1systems/cd/config.nix b/tv/1systems/cd/config.nix index f78bcaf..341a62e 100644 --- a/tv/1systems/cd/config.nix +++ b/tv/1systems/cd/config.nix @@ -1,8 +1,9 @@ -{ config, lib, pkgs, ... }: - with import ; +{ config, pkgs, ... }: let + + bestGuessGateway = addr: elemAt (match "(.*)(\.[^.])" addr) 0 + ".1"; -{ +in { krebs.build.host = config.krebs.hosts.cd; imports = [ @@ -13,14 +14,14 @@ with import ; ]; - networking = { + networking = let + address = config.krebs.build.host.nets.internet.ip4.addr; + in { + defaultGateway = bestGuessGateway address; interfaces.enp2s1.ip4 = singleton { - address = let - addr = "45.62.237.203"; - in assert config.krebs.build.host.nets.internet.ip4.addr == addr; addr; + inherit address; prefixLength = 24; }; - defaultGateway = "45.62.237.1"; nameservers = ["8.8.8.8"]; }; -- cgit v1.2.3