diff options
author | tv <tv@shackspace.de> | 2015-07-16 17:59:43 +0200 |
---|---|---|
committer | tv <tv@shackspace.de> | 2015-07-16 18:00:42 +0200 |
commit | 814eae09ff808eaf50cfb377d07fc9acf868ef52 (patch) | |
tree | 38d19fcd7d8abc7e4096a9a77ea1d22cd2f09c9d | |
parent | 02b9e32b5b53ac2fc38aa38c978df909e2412b69 (diff) |
3 tv.identity: hosts can have subdomains
-rw-r--r-- | 3modules/tv/identity.nix | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/3modules/tv/identity.nix b/3modules/tv/identity.nix index c3c2f17bf..e0cd46c06 100644 --- a/3modules/tv/identity.nix +++ b/3modules/tv/identity.nix @@ -1,4 +1,4 @@ -{ lib, ... }: +{ config, lib, ... }: with lib; let @@ -6,7 +6,7 @@ let out = { options.tv.identity = api; - #config = mkIf cfg.enable imp; + config = mkIf cfg.enable imp; }; api = { @@ -22,6 +22,8 @@ let #dc = "cac"; dc = "tv"; fqdn = "cd.retiolum"; + subdomains = [ + ]; addr = "10.243.113.222"; #addr6 = "42:4522:25f8:36bb:8ccb:0150:231a:2af3"; #internet-addr = "162.219.5.183"; @@ -31,6 +33,8 @@ let #dc = "cac"; dc = "tv"; fqdn = "mkdir.retiolum"; + subdomains = [ + ]; addr = "10.243.113.223"; cores = 1; }; @@ -38,6 +42,8 @@ let #dc = "gg"; dc = "tv"; fqdn = "nomic.retiolum"; + subdomains = [ + ]; addr = "10.243.0.110"; cores = 2; }; @@ -45,6 +51,8 @@ let #dc = "cac"; dc = "tv"; fqdn = "rmdir.retiolum"; + subdomains = [ + ]; addr = "10.243.113.224"; #addr = "42:4522:25f8:36bb:8ccb:0150:231a:2af5"; cores = 1; @@ -53,6 +61,8 @@ let #dc = "gg"; dc = "tv"; fqdn = "wu.retiolum"; + subdomains = [ + ]; addr = "10.243.13.37"; cores = 8; }; @@ -60,8 +70,15 @@ let }; }; - #imp = { - #}; + imp = { + networking.extraHosts = + let + f = name: { addr, fqdn, subdomains, ... }: '' + ${addr} ${toString (map (s: "${s}.${name} ${s}.${fqdn}") subdomains)} + ''; + in + concatStringsSep "\n" (mapAttrsToList f cfg.hosts); + }; in out |