mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-23 01:08:32 +02:00
feat: don't ask for password for wheel group
This commit is contained in:
@@ -41,20 +41,9 @@
|
|||||||
openssh.authorizedKeys.keys = config.users.users."${username}".openssh.authorizedKeys.keys;
|
openssh.authorizedKeys.keys = config.users.users."${username}".openssh.authorizedKeys.keys;
|
||||||
};
|
};
|
||||||
|
|
||||||
# DO NOT promote the specified user to input password for `nix-store` and `nix-copy-closure`
|
# The wheel group is a special user group,
|
||||||
security.sudo.extraRules = [
|
# which can access to the `su` or `sudo` command to run commands as super user.
|
||||||
{
|
#
|
||||||
users = [username];
|
# Don't ask for password for wheel group
|
||||||
commands = [
|
security.sudo.wheelNeedsPassword = false;
|
||||||
{
|
|
||||||
command = "/run/current-system/sw/bin/nix-store";
|
|
||||||
options = ["NOPASSWD"];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
command = "/run/current-system/sw/bin/nix-copy-closure";
|
|
||||||
options = ["NOPASSWD"];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user