From 8f50d803ef9c94fb82909e22b603982a0a522aea Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Tue, 15 Apr 2014 14:46:35 +0000 Subject: [PATCH] nixos: add support for mkhomedir in PAM --- nixos/modules/security/pam.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/nixos/modules/security/pam.nix b/nixos/modules/security/pam.nix index b1b75a0068d..2a1606e42f3 100644 --- a/nixos/modules/security/pam.nix +++ b/nixos/modules/security/pam.nix @@ -126,6 +126,16 @@ let description = "Whether to show the message of the day."; }; + makeHomeDir = mkOption { + default = false; + type = types.bool; + description = '' + Whether to try to create home directories for users + with $HOMEs pointing to nonexistent + locations on session login. + ''; + }; + updateWtmp = mkOption { default = false; type = types.bool; @@ -192,6 +202,8 @@ let "session ${ if config.boot.isContainer then "optional" else "required" } pam_loginuid.so"} + ${optionalString cfg.makeHomeDir + "session required ${pkgs.pam}/lib/security/pam_mkhomedir.so silent skel=/etc/skel umask=0022"} ${optionalString cfg.updateWtmp "session required ${pkgs.pam}/lib/security/pam_lastlog.so silent"} ${optionalString config.users.ldap.enable