From 08c9a0ad5e1280524b9c391617c386a36a53e94e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Sun, 24 Feb 2013 11:54:01 +0100 Subject: [PATCH] Add service.logind.extraConfig option So that we can customize systemd-logind in configuration.nix. Example: services.logind.extraConfig = "HandleLidSwitch=ignore"; See man logind.conf for available options. --- modules/system/boot/systemd.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/modules/system/boot/systemd.nix b/modules/system/boot/systemd.nix index ddb6dd3db266..9da3afa59985 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 =