niri and yubikey login config
This commit is contained in:
parent
b40f1fc5fb
commit
3641a241a1
3 changed files with 29 additions and 2 deletions
|
@ -64,6 +64,7 @@ in {
|
||||||
settings = import ./niri.conf.nix {
|
settings = import ./niri.conf.nix {
|
||||||
lib = lib;
|
lib = lib;
|
||||||
config = config;
|
config = config;
|
||||||
|
pkgs = pkgs;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -92,6 +93,22 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.swayidle = let
|
||||||
|
lockCmd = "${config.home-manager.users.${conf.username}.programs.swaylock.package}/bin/swaylock";
|
||||||
|
in {
|
||||||
|
enable = true;
|
||||||
|
events = [
|
||||||
|
{
|
||||||
|
event = "lock";
|
||||||
|
command = lockCmd;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
event = "before-sleep";
|
||||||
|
command = lockCmd;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
services.mako = {
|
services.mako = {
|
||||||
enable = true;
|
enable = true;
|
||||||
defaultTimeout = 5000;
|
defaultTimeout = 5000;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
config,
|
config,
|
||||||
|
pkgs,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (config.conf) keys extraLayout;
|
inherit (config.conf) keys extraLayout;
|
||||||
|
@ -128,7 +129,6 @@ in {
|
||||||
|
|
||||||
spawn-at-startup = [
|
spawn-at-startup = [
|
||||||
{command = ["waybar"];}
|
{command = ["waybar"];}
|
||||||
{command = ["swayidle" "-w" "before-sleep" "swaylock"];}
|
|
||||||
];
|
];
|
||||||
|
|
||||||
binds = {
|
binds = {
|
||||||
|
@ -258,7 +258,7 @@ in {
|
||||||
"Print".action.screenshot-screen = [];
|
"Print".action.screenshot-screen = [];
|
||||||
|
|
||||||
# Exit
|
# Exit
|
||||||
"Mod+Shift+L".action.spawn = "swaylock";
|
"Mod+Shift+L".action.spawn = ["${pkgs.systemd}/bin/loginctl" "lock-session"];
|
||||||
"Mod+Shift+Q".action.quit = [];
|
"Mod+Shift+Q".action.quit = [];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,5 +31,15 @@ in
|
||||||
cue = true;
|
cue = true;
|
||||||
control = "required";
|
control = "required";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Lock when removing yubikey
|
||||||
|
services.udev.extraRules = ''
|
||||||
|
ACTION=="remove",\
|
||||||
|
ENV{ID_BUS}=="usb",\
|
||||||
|
ENV{ID_MODEL_ID}=="0407",\
|
||||||
|
ENV{ID_VENDOR_ID}=="1050",\
|
||||||
|
ENV{ID_VENDOR}=="Yubico",\
|
||||||
|
RUN+="${pkgs.systemd}/bin/loginctl lock-sessions"
|
||||||
|
'';
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue