I am using i3 on nixos. I want to use securelock
when my system times out, manual lock, etc.
It looks like there are many ways to set this up and tools to trigger the locking, etc. and I am getting a bit lost on what combination I need. I see some posts about making change to the i3 config, but I would ideally want this to be done with my nixos configuration directly if possible.
If I do somethin simple like:
programs.i3lock.enable = true;
It will work, triggers on timeout, triggers if I manually call something like xset s activate
, etc. But I do not like the default i3lock.
I tried a config like this:
{ config, inputs, lib, pkgs, platform, username, ... }:
{
environment.systemPackages = with pkgs; [
xsecurelock
];
programs.xss-lock.enable = true;
programs.xss-lock.lockerCommand = "xsecurelock";
}
but when I do this configuration and run xss-lock
I get a “command not found” error.
If I install xss-lock
as a package it will be present, but it still doesn’t do anything from the lockerCommand option seems not to be active.
Somewhere in the searching I saw something that said xss-lock
won’t activate this way unless you also have display manager explicitly set, something like:
services.xserver.displayManager.lightdm.enable = true;
I tried the above without the manual environment.systemPackages
, but it would still be command not found.
xsecurelock
works if I just call it manually from CLI, what do I need to do to get it to trigger automatically system wide?
Is the i3block still somehow active or specified? It seems to only be present if I enable it in my config.
I see in the base/default i3 config a line for xss-lock:
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork
Even if this needs to then be changed to use xsecurelock, it seems that it is expecting it to run via xss-lock, which is not installing via the option?
Is it enough to just install the package manually and then manually change i3? Would prefer a way of setting this up with my configuration to avoid manual edits / copying files / home-manager / etc.