How do I add pam_kwallet5.so to /etc/pam.d/sddm?

Hi

I’m still dealing with problems from trying to use KWallet with Hyprland (see https://discourse.nixos.org/t/hyprland-with-uwsm-no-secret-service-available-on-login-kwallet-is-installed-but-it-wont-start-and-autounlock/).

KWallet will not auto-unlock when logging (SDDM) into Hyprland (managed with UWSM). I was reading the Arch Wiki and it says that adding pam_kwallet5.so should not be necessary because SDDM already have the entries.

Well, checking the file, I see that’s not the case in NixOS:

───────┬───────────────────────────────────────────────────────────────────────────────────
       │ File: /etc/pam.d/sddm
───────┼───────────────────────────────────────────────────────────────────────────────────
   1   │ auth      substack      login
   2   │ account   include       login
   3   │ password  substack      login
   4   │ session   include       login
───────┴───────────────────────────────────────────────────────────────────────────────────

The one that has them is /etc/pam.d/kde!

So I tried adding the entries with this:

    security.pam.services.sddm.kwallet = {
      enable = true;
    };

But I check, and still nothing; the files stay the same :(. Please help me! I’m tired of having to log into all my accounts after entering Hyprland for every reboot!

This works for me with KDE:

  security.pam.services = {
    sddm-autologin.text = lib.mkForce ''
      auth     requisite pam_nologin.so
      auth     optional  ${config.systemd.package}/lib/security/pam_systemd_loadkey.so
      auth     optional  ${pkgs.kdePackages.kwallet-pam}/lib/security/pam_kwallet5.so
      auth     optional  ${pkgs.gnome-keyring}/lib/security/pam_gnome_keyring.so
      auth     required  pam_succeed_if.so uid >= ${toString config.services.displayManager.sddm.autoLogin.minimumUid} quiet
      auth     required  pam_permit.so
      account  include   sddm
      password include   sddm
      session  include   sddm
    '';
  };
1 Like

so you copied the original content, added your entries in the corresponding place and use that as value?

I just enabled GDM. That was my “solution”