DEVELOPMENT ENVIRONMENT

~liljamo/nix-arta

ref: 05ad1d6833f47aadbdf22782a4b18e2c78ae068b nix-arta/lxc/util.nix -rw-r--r-- 612 bytes
05ad1d68Jonni Liljamo fix(lxc/roles/base): set mutableUsers to false 9 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{lib, ...}: let
  hostnameIPv4 = {
    "dns" = "10.1.2.3";
    "metrics" = "10.1.2.5";
    "oci" = "10.1.2.9";
    "proxy" = "10.1.2.10";
    "auth" = "10.1.2.12";
    "cloud" = "10.1.2.15";
    "social" = "10.1.2.17";
  };

  # getIPv4 "hostname"
  getIPv4 = hostname: hostnameIPv4.${hostname};

  # getHostnames
  getHostnames = builtins.attrNames hostnameIPv4;

  # getDNSEntries
  getDNSEntries =
    lib.attrsets.mapAttrs'
    (name: value: lib.attrsets.nameValuePair (name + ".home.arpa") value)
    hostnameIPv4;
in {
  getIPv4 = getIPv4;
  getHostnames = getHostnames;
  getDNSEntries = getDNSEntries;
}