add derived isPhysical and isVirtual values for machines

This commit is contained in:
Pim Kunis 2024-02-29 20:51:52 +01:00
parent 960d3f6075
commit 0fe9aef9f5
6 changed files with 20 additions and 9 deletions

View file

@ -48,7 +48,7 @@ in {
config = {
networking = {
domain = if machine.kind == "physical" then "hyp" else "dmz";
domain = if machine.isPhysical then "hyp" else "dmz";
nftables.enable = true;
useDHCP = false;
@ -117,7 +117,7 @@ in {
networkConfig.Bridge = cfg.dmz.bridgeName;
};
})
(lib.optionalAttrs (machine.kind == "virtual") {
(lib.optionalAttrs machine.isVirtual {
"30-main-nic" = {
matchConfig.Name = "en*";