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.
This commit is contained in:
Bjørn Forsman 2013-02-24 11:54:01 +01:00 committed by Eelco Dolstra
parent 568683316b
commit 08c9a0ad5e

View File

@ -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 { systemd.enableEmergencyMode = mkOption {
default = true; default = true;
type = types.bool; type = types.bool;
@ -508,6 +518,13 @@ in
''; '';
target = "systemd/journald.conf"; target = "systemd/journald.conf";
} }
{ source = pkgs.writeText "logind.conf"
''
[Logind]
${config.services.logind.extraConfig}
'';
target = "systemd/logind.conf";
}
]; ];
system.activationScripts.systemd = system.activationScripts.systemd =