no longer log out when yubikey is removed

This commit is contained in:
Grimmauld 2024-12-01 11:01:46 +01:00
parent 19f05aec9f
commit 4b1e60ab0a
Signed by: Grimmauld
SSH key fingerprint: SHA256:Q8IL6Y7sSKqzkyFdV1L0O/EflEh1fFV3tBtwxpapRH4
2 changed files with 6 additions and 28 deletions

View file

@ -63,6 +63,9 @@ in
expect
gptfdisk
qrencode
man-pages
man-pages-posix
]
++ optionals graphical [
wev
@ -94,6 +97,8 @@ in
MANROFFOPT = "-c";
};
documentation.dev.enable = true;
# virtualisation.docker.enable = true;
services.dbus.implementation = "broker";

View file

@ -1,7 +1,5 @@
{
config,
lib,
pkgs,
...
}:
{
@ -18,36 +16,11 @@
boot.supportedFilesystems.zfs = true;
# security.pam.yubico.control = "required";
services.udev.extraRules =
let
inherit (lib) getExe' getExe;
inherit (pkgs) procps writeShellScriptBin;
exitSway = writeShellScriptBin "kill-sway" ''
for pid in $(${getExe' procps "pgrep"} sway -x)
do
uid=$(id -u $(${getExe' procps "ps"} -o user= -p $pid))
export SWAYSOCK="/run/user/$uid/sway-ipc.$uid.$pid.sock"
if [[ -e "$SWAYSOCK" ]] ; then
echo "sock is $SWAYSOCK"
${getExe' config.programs.sway.package "swaymsg"} exit
fi
done
'';
in
''
ACTION=="remove",\
ENV{SUBSYSTEM}=="usb",\
ENV{PRODUCT}=="1050/407/543",\
RUN+="${lib.getExe exitSway}"
# '';
services.printing.cups-pdf.enable = true; # implies printing enable
# services.printing.enable = true;
security.apparmor.enable = true;
# RUN+="${lib.getExe' pkgs.systemd "loginctl"} lock-sessions"
# networking.hostId = "2ea79333";
# boot.kernelPackages = lib.mkForce config.boot.zfs.package.latestCompatibleLinuxPackages;