···223223 '';
224224 };
225225226226+ enableGnomeKeyring = mkOption {
227227+ default = false;
228228+ type = types.bool;
229229+ description = ''
230230+ If enabled, pam_gnome_keyring will attempt to automatically unlock the
231231+ user's default Gnome keyring upon login. If the user login password does
232232+ not match their keyring password, Gnome Keyring will prompt separately
233233+ after login.
234234+ '';
235235+ };
236236+226237 text = mkOption {
227238 type = types.nullOr types.lines;
228239 description = "Contents of the PAM service file.";
···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
276276- (optionalString (cfg.unixAuth && (config.security.pam.enableEcryptfs || cfg.pamMount || cfg.enableKwallet)) ''
287287+ (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"}
···282293 ${optionalString cfg.enableKwallet
283294 ("auth optional ${pkgs.plasma5.kwallet-pam}/lib/security/pam_kwallet5.so" +
284295 " kwalletd=${pkgs.libsForQt5.kwallet.bin}/bin/kwalletd5")}
296296+ ${optionalString cfg.enableGnomeKeyring
297297+ ("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"}
···351364 ${optionalString (cfg.enableKwallet)
352365 ("session optional ${pkgs.plasma5.kwallet-pam}/lib/security/pam_kwallet5.so" +
353366 " kwalletd=${pkgs.libsForQt5.kwallet.bin}/bin/kwalletd5")}
367367+ ${optionalString (cfg.enableGnomeKeyring)
368368+ "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 '');