Update modules/users.nix modules/workspace/i3/default.nix

This commit is contained in:
Alexander Bantyev 2020-03-02 12:58:15 +03:00
parent 8983481dc1
commit 9fda500a7f
2 changed files with 12 additions and 4 deletions

View File

@ -39,15 +39,22 @@
services.udev.extraRules = ''
ACTION=="remove", ATTRS{idVendor}=="1050", RUN+="${pkgs.systemd}/bin/loginctl lock-sessions"
'';
security.wrappers.vlock.source = "${pkgs.vlock}/bin/vlock";
services.mingetty.autologinUser = "balsoft";
environment.loginShellInit = "sudo /run/current-system/sw/bin/lock; sway";
security.pam.u2f = {
control = "sufficient";
cue = true;
enable = true;
};
environment.systemPackages = [
(pkgs.writeShellScriptBin "lock"
"USER=balsoft ${pkgs.vlock}/bin/vlock -san")
];
security.pam.services = builtins.listToAttrs (builtins.map (name: {
inherit name;
value = { unixAuth = false; };
@ -80,6 +87,7 @@
security.sudo = {
enable = true;
extraConfig = ''
balsoft ALL = (root) NOPASSWD: /run/current-system/sw/bin/lock
balsoft ALL = (root) NOPASSWD: ${pkgs.light}/bin/light -A 5
balsoft ALL = (root) NOPASSWD: ${pkgs.light}/bin/light -U 5
'';

View File

@ -2,8 +2,8 @@
let
thm = config.themes.colors;
apps = config.defaultApplications;
lock_fork = pkgs.writeShellScript "lock_fork" "/run/wrappers/bin/vlock -san &";
lock = pkgs.writeShellScript "lock" "swaymsg 'output * dpms off'; /run/wrappers/bin/vlock -san; swaymsg 'output * dpms on'";
lock_fork = pkgs.writeShellScript "lock_fork" "sudo /run/current-system/sw/bin/lock &";
lock = pkgs.writeShellScript "lock" "swaymsg 'output * dpms off'; sudo /run/current-system/sw/bin/lock; swaymsg 'output * dpms on'";
in {
environment.sessionVariables._JAVA_AWT_WM_NONREPARENTING = "1";