Keep routers and the installer running with the lid closed
logind suspends laptops on lid close by default; a router (and an install in progress) must keep running. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AeFqV9dZrK6nipHkPfyM4F
This commit is contained in:
@@ -16,6 +16,13 @@
|
|||||||
isoImage.volumeID = "ROUTER_INSTALL";
|
isoImage.volumeID = "ROUTER_INSTALL";
|
||||||
isoImage.squashfsCompression = "zstd -Xcompression-level 6";
|
isoImage.squashfsCompression = "zstd -Xcompression-level 6";
|
||||||
|
|
||||||
|
# Installing on a laptop must survive closing its lid.
|
||||||
|
services.logind.settings.Login = {
|
||||||
|
HandleLidSwitch = "ignore";
|
||||||
|
HandleLidSwitchExternalPower = "ignore";
|
||||||
|
HandleLidSwitchDocked = "ignore";
|
||||||
|
};
|
||||||
|
|
||||||
services.openssh = {
|
services.openssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings.PermitRootLogin = "prohibit-password";
|
settings.PermitRootLogin = "prohibit-password";
|
||||||
|
|||||||
@@ -9,5 +9,6 @@
|
|||||||
./dhcp.nix
|
./dhcp.nix
|
||||||
./dns.nix
|
./dns.nix
|
||||||
./rollback.nix
|
./rollback.nix
|
||||||
|
./power.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# A router keeps routing with the lid shut: laptops make fine routers, but
|
||||||
|
# logind suspends them on lid close by default.
|
||||||
|
{ config, lib, ... }:
|
||||||
|
{
|
||||||
|
config = lib.mkIf config.router.enable {
|
||||||
|
services.logind.settings.Login = {
|
||||||
|
HandleLidSwitch = "ignore";
|
||||||
|
HandleLidSwitchExternalPower = "ignore";
|
||||||
|
HandleLidSwitchDocked = "ignore";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user