diff --git a/modules/system/boot/systemd.nix b/modules/system/boot/systemd.nix index ddb6dd3db26..9da3afa5998 100644 --- a/modules/system/boot/systemd.nix +++ b/modules/system/boot/systemd.nix @@ -462,6 +462,16 @@ in ''; }; + services.logind.extraConfig = mkOption { + default = ""; + type = types.uniq types.string; + example = "HandleLidSwitch=ignore"; + description = '' + Extra config options for systemd-logind. See man logind.conf for + available options. + ''; + }; + systemd.enableEmergencyMode = mkOption { default = true; type = types.bool; @@ -508,6 +518,13 @@ in ''; target = "systemd/journald.conf"; } + { source = pkgs.writeText "logind.conf" + '' + [Logind] + ${config.services.logind.extraConfig} + ''; + target = "systemd/logind.conf"; + } ]; system.activationScripts.systemd =