How to automatically unlock kwallet at start up?

Hi there, how can I automatically unlock kwallet at start up?
It kept asking for password at start up and I would like it to automatically unlock.

Thank you.

I use something like that in my configuration.nix

  security = {
    # If enabled, pam_wallet will attempt to automatically unlock the user’s default KDE wallet upon login.
    # If the user has no wallet named “kdewallet”, or the login password does not match their wallet password,
    # KDE will prompt separately after login.
    pam = {
      services = {
        ${userSettings.username} = {
          kwallet = {
            enable = true;
            package = pkgs.kdePackages.kwallet-pam;
          };
        };
      };
    };
};

error:
… while evaluating the attribute ‘config.system.build.toplevel’
at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:1:12284:
… while calling the ‘seq’ builtin
at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:1:12293:
(stack trace truncated; use ‘–show-trace’ to show the full, detailed trace)

   error: undefined variable 'userSettings'
   at /etc/nixos/configuration.nix:94:7:
       93|   security.pam.services = {
       94|     ${userSettings.username} = {
         |       ^
       95|       kwallet = {

I’m sorry I just pasted a chunk of my config. In this place you have to put your user name.
I mean instead ${userSettings.username} print "your_user_name"
Read more here.
P.S. For more understanding read this article from ArchWiki but keep in mind it’s ArchLinux not NixOs.