diff --git a/hosts/yodaTab/configuration.nix b/hosts/yodaTab/configuration.nix index c81eb9e..7a2e97e 100644 --- a/hosts/yodaTab/configuration.nix +++ b/hosts/yodaTab/configuration.nix @@ -47,6 +47,7 @@ in #../../modules/android.nix #../../modules/podman.nix #../../modules/docker.nix + ../../modules/lid-switch-handling.nix ]; networking.hostName = "yodaTab"; diff --git a/hosts/yodaTux/configuration.nix b/hosts/yodaTux/configuration.nix index 423139d..2474001 100644 --- a/hosts/yodaTux/configuration.nix +++ b/hosts/yodaTux/configuration.nix @@ -47,6 +47,7 @@ in ../../modules/android.nix #../../modules/podman.nix ../../modules/docker.nix + ../../modules/lid-switch-handling.nix ]; networking.hostName = "yodaTux"; diff --git a/hosts/yodaYoga/configuration.nix b/hosts/yodaYoga/configuration.nix index 28ab0a4..ebe8cdd 100644 --- a/hosts/yodaYoga/configuration.nix +++ b/hosts/yodaYoga/configuration.nix @@ -49,6 +49,7 @@ in #../../modules/android.nix #../../modules/podman.nix ../../modules/docker.nix + ../../modules/lid-switch-handling.nix ]; networking.hostName = "yodaYoga"; diff --git a/modules/lid-switch-handling.nix b/modules/lid-switch-handling.nix new file mode 100644 index 0000000..bd02d57 --- /dev/null +++ b/modules/lid-switch-handling.nix @@ -0,0 +1,10 @@ +{ config, pkgs, ... }: + +{ + # Don't suspend if laptop lid is closed while plugged in. + # https://unix.stackexchange.com/a/307498 + # + # services.logind.lidSwitch = "suspend"; + services.logind.lidSwitchExternalPower = "ignore"; + #services.logind.lidSwitchDocked = "ignore"; +} diff --git a/modules/yodaYoga.nix b/modules/yodaYoga.nix index bf59686..b9052e2 100644 --- a/modules/yodaYoga.nix +++ b/modules/yodaYoga.nix @@ -1,9 +1,6 @@ { config, pkgs, ... }: { - services.logind.lidSwitch = "ignore"; - #services.logind.lidSwitchDocked = "ignore"; - users.users.yoda = { packages = with pkgs; [ git