From 49a749c7299eac1ee1fc401d376db245cb834a73 Mon Sep 17 00:00:00 2001 From: David Reiss Date: Wed, 14 Oct 2020 17:29:30 -0700 Subject: nixos/pam_mount: add pamMount attribute to users This attribute is a generalized version of cryptHomeLuks for creating an entry in /etc/security/pam_mount.conf.xml. It lets the configuration control all the attributes of the entry, instead of just the path. The default path remains the value of cryptHomeLuks, for compatibility. --- nixos/modules/security/pam_mount.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'nixos/modules/security/pam_mount.nix') diff --git a/nixos/modules/security/pam_mount.nix b/nixos/modules/security/pam_mount.nix index 77e22a96b55..89211bfbde4 100644 --- a/nixos/modules/security/pam_mount.nix +++ b/nixos/modules/security/pam_mount.nix @@ -39,8 +39,16 @@ in environment.etc."security/pam_mount.conf.xml" = { source = let - extraUserVolumes = filterAttrs (n: u: u.cryptHomeLuks != null) config.users.users; - userVolumeEntry = user: "\n"; + extraUserVolumes = filterAttrs (n: u: u.cryptHomeLuks != null || u.pamMount != {}) config.users.users; + mkAttr = k: v: ''${k}="${v}"''; + userVolumeEntry = user: let + attrs = { + user = user.name; + path = user.cryptHomeLuks; + mountpoint = user.home; + } // user.pamMount; + in + "\n"; in pkgs.writeText "pam_mount.conf.xml" '' -- cgit 1.4.1