-
Notifications
You must be signed in to change notification settings - Fork 4
/
users.nix
49 lines (47 loc) · 1.21 KB
/
users.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{ config, pkgs, ... }:
{
users.mutableUsers = false;
# mkpasswd
users.users.root.hashedPassword = "$y$j9T$jNNA0ypXSyA5w/mJuVEv40$47Nj8hIM95QdQdUFQGdO9Cf/m8DTKun2WFIeDuOzYuC";
users.groups = {
sabo.gid = 1000;
};
users.users.sabo = {
hashedPassword = "$y$j9T$ZJNqt.Mr7MiOpsgfbGGRt.$7IzejPdTbEOT6sYAvIUB2P/Ro.54nJJIRR1kw0Zhvt1";
isNormalUser = true;
home = "/home/sabo";
shell = pkgs.zsh;
uid = 1000;
group = "sabo";
extraGroups = [ "wheel" "networkmanager" ]; # Enable ‘sudo’ for the user.
# packages = with pkgs; [
# firefox
# tree
# ];
};
# sudo
security.sudo = {
enable = true;
extraRules = [{
commands = [
{
command = "${pkgs.systemd}/bin/systemctl suspend";
options = [ "NOPASSWD" ];
}
{
command = "${pkgs.systemd}/bin/reboot";
options = [ "NOPASSWD" ];
}
{
command = "${pkgs.systemd}/bin/poweroff";
options = [ "NOPASSWD" ];
}
];
groups = [ "wheel" ];
}];
extraConfig = ''
sabo ALL=(ALL:ALL) NOPASSWD: /run/current-system/sw/bin/ydotool
sabo ALL=(ALL:ALL) NOPASSWD: /run/current-system/sw/bin/ydotoold
'';
};
}