mirror of
https://github.com/Superredstone/nixos.git
synced 2026-06-17 15:24:39 +02:00
feat(sudo): add sane rules
This commit is contained in:
@@ -1,9 +1,42 @@
|
|||||||
{ currentSystemUser, ... }:
|
{ currentSystemUser, ... }:
|
||||||
|
let
|
||||||
|
swBin = "/run/current-system/sw/bin";
|
||||||
|
wrappersBin = "/run/wrappers/bin";
|
||||||
|
in
|
||||||
{
|
{
|
||||||
security.sudo.extraConfig = ''
|
security.sudo = {
|
||||||
Defaults pwfeedback
|
extraConfig = ''
|
||||||
Defaults timestamp_timeout=120
|
Defaults pwfeedback
|
||||||
'';
|
Defaults timestamp_timeout=120
|
||||||
|
'';
|
||||||
|
extraRules = [
|
||||||
|
{
|
||||||
|
groups = [ "wheel" ];
|
||||||
|
commands = [
|
||||||
|
{
|
||||||
|
command = "${swBin}/shutdown";
|
||||||
|
options = [ "NOPASSWD" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
command = "${swBin}/reboot";
|
||||||
|
options = [ "NOPASSWD" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
command = "${swBin}/poweroff";
|
||||||
|
options = [ "NOPASSWD" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
command = "${wrappersBin}/mount";
|
||||||
|
options = [ "NOPASSWD" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
command = "${wrappersBin}/umount";
|
||||||
|
options = [ "NOPASSWD" ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
sops = {
|
sops = {
|
||||||
age.sshKeyPaths = [
|
age.sshKeyPaths = [
|
||||||
"/etc/ssh/ssh_host_ed25519_key"
|
"/etc/ssh/ssh_host_ed25519_key"
|
||||||
|
|||||||
Reference in New Issue
Block a user