Update modules/users.nix

This commit is contained in:
Alexander Bantyev 2020-03-01 23:56:51 +03:00
parent e10a2c61e8
commit 995ca87bce
1 changed files with 3 additions and 2 deletions

View File

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