dot_testing/modules/power-control.nix
2024-01-15 03:52:45 -06:00

26 lines
535 B
Nix

{ lib, config, pkgs, inputs, ...}:
{
# let regular users control power
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" ];
}];
};
}