nixos: Add actual IP / CIDR calculation
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
{ lib, ... }: {
|
||||
{ lib, ... }:
|
||||
let
|
||||
inherit (lib.my) net;
|
||||
inherit (lib.my.colony) domain prefixes;
|
||||
in
|
||||
{
|
||||
imports = [ ./vms ];
|
||||
|
||||
nixos.systems.colony = {
|
||||
@@ -9,31 +14,31 @@
|
||||
assignments = {
|
||||
routing = {
|
||||
name = "colony-routing";
|
||||
domain = lib.my.colony.domain;
|
||||
ipv4.address = "${lib.my.colony.start.base.v4}2";
|
||||
inherit domain;
|
||||
ipv4.address = net.cidr.host 2 prefixes.base.v4;
|
||||
};
|
||||
internal = {
|
||||
altNames = [ "vm" ];
|
||||
domain = lib.my.colony.domain;
|
||||
inherit domain;
|
||||
ipv4 = {
|
||||
address = "${lib.my.colony.start.vip1}4";
|
||||
address = net.cidr.host 0 prefixes.vip1;
|
||||
mask = 32;
|
||||
gateway = null;
|
||||
genPTR = false;
|
||||
};
|
||||
ipv6 = {
|
||||
iid = "::2";
|
||||
address = "${lib.my.colony.start.base.v6}2";
|
||||
address = net.cidr.host 2 prefixes.base.v6;
|
||||
};
|
||||
};
|
||||
vms = {
|
||||
name = "colony-vms";
|
||||
domain = lib.my.colony.domain;
|
||||
inherit domain;
|
||||
ipv4 = {
|
||||
address = "${lib.my.colony.start.vms.v4}1";
|
||||
address = net.cidr.host 1 prefixes.vms.v4;
|
||||
gateway = null;
|
||||
};
|
||||
ipv6.address = "${lib.my.colony.start.vms.v6}1";
|
||||
ipv6.address = net.cidr.host 1 prefixes.vms.v6;
|
||||
};
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user