# A router keeps routing with the lid shut: laptops make fine routers, but # logind suspends them on lid close by default. Also picks the kernel. { config, lib, pkgs, ... }: { config = lib.mkIf config.router.enable { # Newest hardware support (and nftables/WireGuard fixes) over the LTS default. boot.kernelPackages = lib.mkDefault pkgs.linuxPackages_latest; services.logind.settings.Login = { HandleLidSwitch = "ignore"; HandleLidSwitchExternalPower = "ignore"; HandleLidSwitchDocked = "ignore"; }; }; }