Describe the bug
I've set Kwallet to unlock automatically on login but it doesn't unlock.
I'm not using KDE but my own i3-based environment, but I tested that this happens on Xfce too. I've tried SDDM and LightDM as my display manager, both fail to unlock the wallet.
I'm using recent nixos-unstable so I have the fix from this issue: #62045 That was supposed to fix on LightDM but the wallet still isn't unlocking with LightDM either.
This issue is related to KDE: #68316 But perhaps it's the same issue.
To Reproduce
Key parts in configuration.nix:
services.xserver = {
enable = true;
displayManager.sddm.enable = true; # or lightdm
desktopManager.xfce.enable = true;
};
security.pam.services = {
gdm.enableKwallet = true;
kdm.enableKwallet = true;
lightdm.enableKwallet = true;
sddm.enableKwallet = true;
slim.enableKwallet = true;
};
environment.systemPackages = with pkgs; [
kdeFrameworks.kwallet
kdeApplications.kwalletmanager
];
Note: Kwallet must have the same password as the user login.
Steps to reproduce the behavior:
kwalletmanager5.Expected behavior
The wallet should be unlocked.
Metadata
]$ nix run nixpkgs.nix-info -c nix-info -m
- system: `"x86_64-linux"`
- host os: `Linux 4.19.74, NixOS, 20.03.git.0adcf14 (Markhor)`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.3`
- nixpkgs: `/etc/nixpkgs`
Maintainer information:
# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:
If it's the same as #68316, you should see a core for kwalletd like this:
$ coredumpctl
...
Thu 2019-09-26 13:42:07 EDT 2336 1000 100 6 missing /nix/store/38w20yz66bzkmrw6l2ml8x0alj1mkzxq-kwallet-5.61.0-bin/bin/.kwalletd5-wrapped
...
There's no kwalletd in my coredumpctl output. Well, there's one instance yesterday when I tried running KDE Plasma once. But as I've been logging in and out many many times during the last few days to my custom DE, there should've been plenty of those if it happened on my DE.
@jluttine Could you try out this PR: #70140, I suspect it will fix your case as well.
You also need to make sure /run/current-system/sw/etc/xdg/autostart/pam_kwallet_init.desktop is being run on startup.
@matthewbauer Thanks! Now it works. I cherry-picked the commit from the PR and ran ${pkgs.kwallet-pam}/libexec/pam_kwallet_init at DE start-up (that was the command the desktop file would have run, so yes, autostarting that desktop file would have worked too). Thanks a lot!
Just for reference: I was missing pkgs.kwallet-pam from environment.systemPackages. Adding the package there and having some tool that runs autostart desktop files should do the trick (and also having the PR fix).
I have the same issue with the following setup:
security.pam.services.lightdm.enableKwallet = true;kwallet-pam and kdeFrameworks.kwallet in environment.systemPackageshome-manager manages the xsession which means that it generates a .xsession file that starts the window manager (i3 in my case)${pkgs.kwallet-pam}/libexec/pam_kwallet_init into .xsession via home-manager/run/current-system/sw/etc/xdg/autostart/pam_kwallet_init.desktop is presentThe result is that in NixOS 20.03 kwalletd does not start at all and there is no entry in the coredumpctl log either. I can, however, unlock the wallet manually with kwalletmanager.
With NixOS 19.09 kwalletd did start automatically but was not unlocked automatically despite naming it kdewallet and it having the same password as my user.
Any further ideas on what I could try to alleviate this issue?
@lukasstevens Perhaps you are affected by #77290 which was fixed in https://github.com/NixOS/nixpkgs/commit/8021f0a4a54b03bc9cd1f4c1d40e00fa28ec6ad9?
If this is would be the root of the issue, I should have entries in coredumpctl, right? As I said, there are no entries for kwalletd in there.
@lukasstevens I don't know, I'm just suggesting. Perhaps open a new issue then if that fix didn't help?
Yeah this sounds like a new issue. I haven't testing lightdm+i3 support, but I expect somehow the autostart is not getting run.