i3lock does not appear to be functioning correctly anymore. Anytime I input the correct password, it refused to unlock. I have been able to unlock by going to tty2 and running pkill i3lock after logging into that terminal session.
I also verified the password I was giving i3lock by running i3lock --debug in my terminal. It prints my key presses and I was able to see that I was in fact inputting my password correctly.
I did some research and it seems like this could be a setup issue on Nixos’s side of things? Specifically related to PAM. I have not touched PAM at all in my configuration but perhaps someone else is more familiar with what’s going on?
Oh you know what, I do not. I did not do this because my i3lock installed manually through my home manager config.
I guess I’ll need to do something hacky here, but I can figure it out. I was trying to setup everything as much as possible through home manager, but it looks like that’s not really going to be possible here.
In a REPL loaded with your NixOS config (on a channels-based system, I’d do this with nix repl --file '<nixpkgs/nixos>'; I don’t know if that works for flakes too), can you confirm that
config.programs.i3lock.enable is definitely true?
config.security.pam.services.i3lock.enable is also true?
I’m at a loss. With those values set to true, I don’t see how it could be possible that a system gets built without an /etc/pam.d/i3lock symlink. I guess double-check that you’re building what you think you’re building?
Hmmm weird, I just checked and have the symlink now and everything works. I did update my flakes sometime during this. But I think it’s very likely possible I mixed up configurations and didn’t have it enabled correctly either. I’m very sorry for the troubles. It looks like things are working find again.
After migrating von NixOS 24.11 (based on nix-channels) to NixOS 25.05 (switched to nix-flakes) I experienced the same issues.
The last time I touched my i3 and pam.d related config was 2 years ago.
Same issue happend to me when I upgraded from the stable 25.05 channel to the unstable channel.
Before my config to install i3 was:
services.xserver = {
# enable = true;
desktopManager = {
xterm.enable = false;
};
windowManager.i3 = {
enable = true;
extraPackages = with pkgs; [
dmenu #application launcher most people use
i3status # gives you the default i3 status bar
i3lock #default i3 screen locker
i3blocks #if you are planning on using i3blocks over i3status
];
};
};
And I changed it to:
services.xserver = {
# enable = true;
desktopManager = {
xterm.enable = false;
};
windowManager.i3 = {
enable = true;
extraPackages = with pkgs; [
dmenu #application launcher most people use
i3status # gives you the default i3 status bar
i3blocks #if you are planning on using i3blocks over i3status
];
};
};
programs.i3lock.enable = true;
Note that I added programs.i3lock.enable = true; and removed i3lock from the extra packages.