29 lines
768 B
Nix
29 lines
768 B
Nix
{ inputs, ... }: {
|
|
flake.modules.nixos.sudo = { pkgs, lib, ... }: {
|
|
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 = with pkgs; ''
|
|
Defaults:picloud secure_path="${lib.makeBinPath [
|
|
systemd
|
|
]}:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin"
|
|
'';
|
|
};
|
|
};
|
|
} |