36 lines
860 B
Nix
Raw Normal View History

2024-02-08 23:21:10 +03:00
{ config, lib, ... }: {
2023-01-26 00:23:55 +03:00
# FIXME: completely remove sudo
2019-09-14 22:12:56 +04:00
security.sudo = {
enable = true;
2022-12-07 22:13:34 +03:00
extraRules = [{
2023-06-27 23:07:48 +03:00
users = [ "deploy" ];
commands = [{
command = "ALL";
options = [ "NOPASSWD" ];
}];
2022-12-07 22:13:34 +03:00
}];
2019-09-14 22:12:56 +04:00
};
2022-12-07 22:13:34 +03:00
security.doas = {
enable = true;
extraRules = [{
2022-12-10 22:34:39 +03:00
users = [ config.mainuser ];
2022-12-07 22:13:34 +03:00
keepEnv = true;
persist = true;
}] ++ lib.optionals config.deviceSpecific.isLaptop [{
2022-12-10 22:34:39 +03:00
users = [ config.mainuser ];
2022-12-07 22:13:34 +03:00
noPass = true;
keepEnv = true;
cmd = "/run/current-system/sw/bin/tlp";
} {
2022-12-10 22:34:39 +03:00
users = [ config.mainuser ];
2022-12-07 22:13:34 +03:00
noPass = true;
keepEnv = true;
cmd = "/run/current-system/sw/bin/tlp-stat";
2024-02-13 01:03:52 +03:00
} {
users = [ config.mainuser ];
noPass = true;
keepEnv = true;
cmd = "/run/current-system/sw/bin/nixos-rebuild";
2022-12-07 22:13:34 +03:00
}];
2021-09-16 01:03:52 +03:00
};
}