lib: FINALLY (?) FIX THE INTERFACE CONUNDRUM

This commit is contained in:
2021-11-05 12:49:58 +01:00
parent 5e8c297d03
commit ec70e43143
3 changed files with 5 additions and 9 deletions

View File

@@ -4,9 +4,7 @@ let
network = import ./network.nix;
isVM = config.ptw.system.isVM;
wireless = config.ptw.system.wireless;
wifiInterface = lib.attrByPath [ "ptw" "hardware" "wifi" "wifiInterface" ] "" config;
primaryInterface = lib.attrByPath [ "ptw" "system" "primaryInterface" ] "" config;
primaryInterfaceWrapper = if (wifiInterface != "" && primaryInterface == "") then wifiInterface else primaryInterface;
in {
time.timeZone = "Europe/Berlin";
ostylk.nftables = {
@@ -28,7 +26,7 @@ in {
ct state { established, related } accept
iif lo accept
iif ${primaryInterfaceWrapper} goto non-libvirt
iif ${primaryInterface} goto non-libvirt
'';
};
};
@@ -160,7 +158,7 @@ in {
enable = true;
};
} // (if wireless then {
wifiInterface = config.ptw.hardware.wifi.wifiInterface;
wifiInterface = primaryInterface;
} else {});
nix.package = pkgs.nixUnstable;