Update modules/users.nix

This commit is contained in:
Alexander Bantyev 2020-03-01 23:49:12 +03:00
parent 468df0520e
commit e10a2c61e8
1 changed files with 10 additions and 1 deletions

View File

@ -37,7 +37,16 @@
"/run/user/1000";
services.udev.extraRules = ''
ACTION=="remove", ATTRS{idVendor}=="1050", RUN+="${pkgs.systemd}/bin/systemctl suspend"'';
ACTION=="remove", ATTRS{idVendor}=="1050", RUN+="${pkgs.systemd}/bin/systemctl start swaylock"'';
systemd.services.swaylock = {
description = "Lock the screen";
serviceConfig.User = "balsoft";
environment.XDG_RUNTIME_DIR = "/run/user/1000";
serviceConfig.Type = "oneshot";
path = [pkgs.swaylock];
script = "swaylock -c ${builtins.substring 1 7 config.themes.colors.bg}";
};
security.pam.u2f = {
control = "sufficient";