EDIT: to be precise, the issue is that the “wallet” is not automatically unlocked on login. I know that because after opening KWalletManager I can just click in “open,” put in my user password, and have the “wallet” open.
However, after using the code suggested in the chosen solution, I still see no secret service available with kwallet (applications that depend on it complain there is no secret service).
security = {
# from
# https://discourse.nixos.org/t/how-to-automatically-unlock-kwallet-at-start-up/61308/2
#
# 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 = {
"jorge" = {
kwallet = {
enable = true;
package = pkgs.kdePackages.kwallet-pam;
};
};
};
mount.additionalSearchPaths = [ pkgs.bindfs ];
};
sudo.enable = true;
rtkit.enable = true;
};
In a terminal, if I run kwalletd6 I see the following:
(process:12259): GLib-GIO-CRITICAL **: 14:20:17.517: g_dbus_proxy_get_object_path: assertion 'G_IS_DBUS_PROXY (proxy)' failed
Secret Service availability changed: Available
qt.dbus.integration: QDBusConnection: name 'org.kde.secretservicecompat' had owner '' but we thought it was ':1.381'
afterwards, if I open an application that requires the secret service, I’m prompted for the wallet password; from there on everything works as expected.
I think that solution is incorrect. You’re not supposed to use your username as the pam service’s name. Put there instead pam service name of the display manager you’re using. For SDDM you would use either login or sddm, for greetd you would use greetd, etc…
For example, I’m using greetd so my config looks like this:
wait, I marked your comment as the solution but nvm. I do see the corresponding output of journalctl --boot --grep=pam_kwallet and have the envvar set too. But, regardless, Proton Bridge complains it couldn’t detect a secret service.
I opened Brave Browser and was asked for my password, what am I missing?
Try accessing the secret service using libsecret’s CLI:
nix-shell -p libsecret
secret-tool store --label='testing' foo bar
secret-tool lookup foo bar
secret-tool clear foo bar
If those commands give some error like secret-tool: The name is not activatable then the secret service is indeed not up, and the error is not just with proton bridge.
If it errors out, I would make sure that pam_kwallet_init has been executed. There is a plasma-kwallet-pam.service that comes with kwallet-pam package which would call pam_kwallet_init normally, but it depend on other plasma services (which do not exist) so it may not be usable.
To overcome that, add call to ${pkgs.kdePackages.kwallet-pam}/libexec/pam_kwallet_init to your Hyprland’s config with exec-once, like in my config.
➜ nix-shell -p libsecret
unpacking 'https://flakehub.com/f/DeterminateSystems/nixpkgs-weekly/0.1' into the Git cache...
these 4 paths will be fetched (0.89 MiB download, 3.90 MiB unpacked):
/nix/store/hq4c9wzzdnxj06f810b5rwkcvv0bb5cf-libgcrypt-1.11.1-lib
/nix/store/10ahhmqpbmy6rpznpjjadwz8c722a256-libgpg-error-1.55
/nix/store/nvxsavc5m25w942qggc7gn4bfkagqcy4-libsecret-0.21.7
/nix/store/ggh2184cdrmaxa69x3hrgzhwhkwi3wyk-libsecret-0.21.7-dev
copying path '/nix/store/10ahhmqpbmy6rpznpjjadwz8c722a256-libgpg-error-1.55' from 'https://cache.nixos.org'...
copying path '/nix/store/hq4c9wzzdnxj06f810b5rwkcvv0bb5cf-libgcrypt-1.11.1-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/nvxsavc5m25w942qggc7gn4bfkagqcy4-libsecret-0.21.7' from 'https://cache.nixos.org'...
copying path '/nix/store/ggh2184cdrmaxa69x3hrgzhwhkwi3wyk-libsecret-0.21.7-dev' from 'https://cache.nixos.org'...
[nix-shell:~]$ secret-tool store --label='testing' foo bar
Password:
secret-tool: The name is not activatable
[nix-shell:~]$
okay, with your recommendation of Hyprland executing pam_kwallet_init I got this:
~
➜ nix-shell -p libsecret
unpacking 'https://flakehub.com/f/DeterminateSystems/nixpkgs-weekly/0.1' into the Git cache...
[nix-shell:~]$ secret-tool store --label='testing' foo bar
Password:
[nix-shell:~]$