nixos/pam: enable lastlog2 import service if any pam service uses lastlog

This commit is contained in:
Grimmauld
2025-08-10 18:55:04 +02:00
parent 3c3c1f56ce
commit f3cd67c5b7

View File

@@ -2311,11 +2311,14 @@ in
environment.etc = lib.mapAttrs' makePAMService enabledServices;
systemd = lib.optionalAttrs config.security.pam.services.login.updateWtmp {
tmpfiles.packages = [ pkgs.util-linux.lastlog ]; # /lib/tmpfiles.d/lastlog2-tmpfiles.conf
services.lastlog2-import.enable = true;
packages = [ pkgs.util-linux.lastlog ]; # lib/systemd/system/lastlog2-import.service
};
systemd =
lib.optionalAttrs
(lib.any (service: service.updateWtmp) (lib.attrValues config.security.pam.services))
{
tmpfiles.packages = [ pkgs.util-linux.lastlog ]; # /lib/tmpfiles.d/lastlog2-tmpfiles.conf
services.lastlog2-import.enable = true;
packages = [ pkgs.util-linux.lastlog ]; # lib/systemd/system/lastlog2-import.service
};
security.pam.services = {
other.text = ''