diff --git a/ops/nixos/blade-tuvok/default.nix b/ops/nixos/blade-tuvok/default.nix index 2033c84918..6f413dbc23 100644 --- a/ops/nixos/blade-tuvok/default.nix +++ b/ops/nixos/blade-tuvok/default.nix @@ -47,7 +47,8 @@ in { my.blade.macAddress = { internal = "e4:11:5b:ac:e3:fe"; storage = "e4:11:5b:ac:e4:02"; - internet = "e4:11:5b:ac:e4:00"; + internet = "e4:11:5b:ac:e3:ff"; + public = "e4:11:5b:ac:e4:00"; }; services.ceph = { diff --git a/ops/nixos/lib/blade.nix b/ops/nixos/lib/blade.nix index 2f55fbfe90..9f6525de97 100644 --- a/ops/nixos/lib/blade.nix +++ b/ops/nixos/lib/blade.nix @@ -24,6 +24,11 @@ in { type = lib.types.nullOr lib.types.str; default = null; }; + macAddress.public = lib.mkOption { + # If not using a VLAN. + type = lib.types.nullOr lib.types.str; + default = null; + }; }; config = { @@ -90,12 +95,15 @@ in { br = interfaces: { interfaces = lib.mkDefault interfaces; rstp = false; }; in { br-mgmt = br [ "en-int" ]; - br-public = br [ "vl-int-public" ]; - }; - vlans.vl-int-public = { - id = 100; - interface = "en-int"; + br-public = br [ (if config.my.blade.macAddress.public == null then "vl-int-public" else "en-public") ]; }; + vlans = ({} // + (if config.my.blade.macAddress.public == null then { + vl-int-public = { + id = 100; + interface = "en-int"; + }; + } else {})); interfaces.br-mgmt.ipv4.addresses = lib.mkBefore [{ address = "10.100.0.${toString (100 + config.my.blade.bay)}"; @@ -132,6 +140,8 @@ in { ATTR{address}=="${config.my.blade.macAddress.storage}", NAME="en-storage" '') + (lib.optionalString (config.my.blade.macAddress.internet != null) '' ATTR{address}=="${config.my.blade.macAddress.internet}", NAME="en-internet" + '') + (lib.optionalString (config.my.blade.macAddress.public != null) '' + ATTR{address}=="${config.my.blade.macAddress.public}", NAME="en-public" ''); virtualisation.podman.enable = true;