2020-02-17 17:00:59 +04:00
|
|
|
|
{ config, pkgs, lib, ... }: {
|
|
|
|
|
security.apparmor.enable = true;
|
|
|
|
|
programs.firejail.enable = true;
|
|
|
|
|
users.mutableUsers = false;
|
|
|
|
|
users.users.balsoft = {
|
|
|
|
|
isNormalUser = true;
|
|
|
|
|
extraGroups = [
|
|
|
|
|
"sudo"
|
|
|
|
|
"wheel"
|
|
|
|
|
"networkmanager"
|
|
|
|
|
"disk"
|
|
|
|
|
"dbus"
|
|
|
|
|
"audio"
|
|
|
|
|
"docker"
|
|
|
|
|
"sound"
|
|
|
|
|
"pulse"
|
|
|
|
|
"adbusers"
|
|
|
|
|
"input"
|
|
|
|
|
"libvirtd"
|
|
|
|
|
"vboxusers"
|
|
|
|
|
"wireshark"
|
|
|
|
|
];
|
|
|
|
|
description = "Александр Бантьев";
|
|
|
|
|
uid = 1000;
|
|
|
|
|
password = "";
|
|
|
|
|
};
|
|
|
|
|
|
2020-03-01 21:30:17 +04:00
|
|
|
|
systemd.services."user@" = { serviceConfig = { Restart = "always"; }; };
|
|
|
|
|
|
2020-03-01 21:49:41 +04:00
|
|
|
|
home-manager.users.balsoft.home.activation.yubi = {
|
2020-03-01 22:10:51 +04:00
|
|
|
|
data =
|
|
|
|
|
"[ -s /home/balsoft/.config/Yubico/u2f_keys ] || (pamu2fcfg > /home/balsoft/.config/Yubico/u2f_keys)";
|
2020-03-01 21:49:41 +04:00
|
|
|
|
after = [ "linkGeneration" ];
|
|
|
|
|
before = [ ];
|
|
|
|
|
};
|
2020-03-01 21:30:17 +04:00
|
|
|
|
home-manager.users.balsoft.home.sessionVariables.XDG_RUNTIME_DIR =
|
|
|
|
|
"/run/user/1000";
|
2020-02-17 17:00:59 +04:00
|
|
|
|
|
2020-03-01 21:30:17 +04:00
|
|
|
|
services.udev.extraRules = ''
|
2020-03-01 22:41:14 +04:00
|
|
|
|
ACTION=="remove", ATTRS{idVendor}=="1050", RUN+="${
|
2020-03-01 21:30:17 +04:00
|
|
|
|
pkgs.writeShellScript "lock-system"
|
2020-03-01 22:41:14 +04:00
|
|
|
|
"/run/wrappers/bin/sudo -u balsoft XDG_RUNTIME_DIR=/run/user/1000/ ${pkgs.swaylock}/bin/swaylock -f -c ${
|
2020-03-01 21:30:17 +04:00
|
|
|
|
builtins.substring 1 7 config.themes.colors.bg
|
2020-03-01 22:41:14 +04:00
|
|
|
|
}"
|
2020-03-01 21:30:17 +04:00
|
|
|
|
}"'';
|
2020-03-01 20:12:07 +04:00
|
|
|
|
security.pam.u2f = {
|
2020-03-01 22:13:59 +04:00
|
|
|
|
control = "sufficient";
|
2020-03-01 20:12:07 +04:00
|
|
|
|
cue = true;
|
|
|
|
|
enable = true;
|
|
|
|
|
};
|
2020-03-01 22:10:51 +04:00
|
|
|
|
|
2020-03-01 22:25:57 +04:00
|
|
|
|
security.pam.services.default.unixAuth = false;
|
2020-03-01 22:10:51 +04:00
|
|
|
|
|
2020-02-17 17:00:59 +04:00
|
|
|
|
security.sudo = {
|
|
|
|
|
enable = true;
|
|
|
|
|
extraConfig = ''
|
|
|
|
|
balsoft ALL = (root) NOPASSWD: ${pkgs.light}/bin/light -A 5
|
|
|
|
|
balsoft ALL = (root) NOPASSWD: ${pkgs.light}/bin/light -U 5
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
nix.requireSignedBinaryCaches = false;
|
|
|
|
|
home-manager.useUserPackages = true;
|
|
|
|
|
}
|