lib: FINALLY (?) FIX THE INTERFACE CONUNDRUM

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

View File

@ -35,15 +35,13 @@
i18n.enable = true; i18n.enable = true;
singleUser = "alexander"; singleUser = "alexander";
hostName = "mashu"; hostName = "mashu";
#wireless = true; wireless = true;
primaryInterface = "wlp1s0";
offloading.offload.enable = true; offloading.offload.enable = true;
}; };
hardware = { hardware = {
intel.enable = true; intel.enable = true;
wifi = { wifi.enable = true;
enable = true;
wifiInterface = "wlp1s0";
};
mobile.enable = true; mobile.enable = true;
surface.enable = true; surface.enable = true;
}; };

View File

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

Binary file not shown.