git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #30686 from gnidorah/keyring

pam: add optional pam_gnome_keyring integration

commit310ad4345bbe42ae7360981243f6602a03fd232f authorJörg Thalheim <Mic92@users.noreply.github.com> dateTue 2 Jan 2018, 14:58 (9 years ago) parent9057682f15fad8
1 file changed+16−1
nixos/modules/security/pam.nix+16−1
nixos/modules/security/pam.nix+16−1
@@ -223,6 +223,17 @@ let
223223 '';
224224 };
225225
226+ enableGnomeKeyring = mkOption {
227+ default = false;
228+ type = types.bool;
229+ description = ''
230+ If enabled, pam_gnome_keyring will attempt to automatically unlock the
231+ user's default Gnome keyring upon login. If the user login password does
232+ not match their keyring password, Gnome Keyring will prompt separately
233+ after login.
234+ '';
235+ };
236+
226237 text = mkOption {
227238 type = types.nullOr types.lines;
228239 description = "Contents of the PAM service file.";
@@ -273,7 +284,7 @@ let
273284 # prompts the user for password so we run it once with 'required' at an
274285 # earlier point and it will run again with 'sufficient' further down.
275286 # We use try_first_pass the second time to avoid prompting password twice
276− (optionalString (cfg.unixAuth && (config.security.pam.enableEcryptfs || cfg.pamMount || cfg.enableKwallet)) ''
287+ (optionalString (cfg.unixAuth && (config.security.pam.enableEcryptfs || cfg.pamMount || cfg.enableKwallet || cfg.enableGnomeKeyring)) ''
277288 auth required pam_unix.so ${optionalString cfg.allowNullPassword "nullok"} likeauth
278289 ${optionalString config.security.pam.enableEcryptfs
279290 "auth optional ${pkgs.ecryptfs}/lib/security/pam_ecryptfs.so unwrap"}
@@ -282,6 +293,8 @@ let
282293 ${optionalString cfg.enableKwallet
283294 ("auth optional ${pkgs.plasma5.kwallet-pam}/lib/security/pam_kwallet5.so" +
284295 " kwalletd=${pkgs.libsForQt5.kwallet.bin}/bin/kwalletd5")}
296+ ${optionalString cfg.enableGnomeKeyring
297+ ("auth optional ${pkgs.gnome3.gnome_keyring}/lib/security/pam_gnome_keyring.so")}
285298 '') + ''
286299 ${optionalString cfg.unixAuth
287300 "auth sufficient pam_unix.so ${optionalString cfg.allowNullPassword "nullok"} likeauth try_first_pass"}
@@ -351,6 +364,8 @@ let
351364 ${optionalString (cfg.enableKwallet)
352365 ("session optional ${pkgs.plasma5.kwallet-pam}/lib/security/pam_kwallet5.so" +
353366 " kwalletd=${pkgs.libsForQt5.kwallet.bin}/bin/kwalletd5")}
367+ ${optionalString (cfg.enableGnomeKeyring)
368+ "session optional ${pkgs.gnome3.gnome_keyring}/lib/security/pam_gnome_keyring.so auto_start"}
354369 ${optionalString (config.virtualisation.lxc.lxcfs.enable)
355370 "session optional ${pkgs.lxcfs}/lib/security/pam_cgfs.so -c freezer,memory,name=systemd,unified,cpuset"}
356371 '');