added sudo and step-client modules
This commit is contained in:
29
modules/programs/sudo.nix
Normal file
29
modules/programs/sudo.nix
Normal file
@@ -0,0 +1,29 @@
|
||||
{ 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"
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user