nixos/pam: refactor pam_mount unmounting fix

This commit is contained in:
Netali 2022-07-22 04:17:14 +02:00
parent 9a56cdb0c9
commit 93132dc09c
No known key found for this signature in database
GPG key ID: 9C55E636426B40A9
2 changed files with 4 additions and 1 deletions

View file

@ -611,7 +611,6 @@ let
session optional ${pkgs.ecryptfs}/lib/security/pam_ecryptfs.so
'' +
optionalString cfg.pamMount ''
session [success=1 default=ignore] ${pkgs.pam}/lib/security/pam_succeed_if.so service = systemd-user quiet
session optional ${pkgs.pam_mount}/lib/security/pam_mount.so disable_interactive
'' +
optionalString use_ldap ''

View file

@ -145,6 +145,10 @@ in {
{ # Ensure that pam_systemd gets included. This is special-cased
# in systemd to provide XDG_RUNTIME_DIR.
startSession = true;
# Disable pam_mount in systemd-user to prevent it from being called
# multiple times during login, because it will prevent pam_mount from
# unmounting the previously mounted volumes.
pamMount = false;
};
# Some overrides to upstream units.