mirror of
https://github.com/RGBCube/ncc
synced 2025-07-31 20:17:45 +00:00
Upgrade sudo config
This commit is contained in:
parent
c73ad40b7f
commit
a1aca8a0d3
1 changed files with 50 additions and 4 deletions
|
@ -1,10 +1,56 @@
|
||||||
{ ulib, ... }: with ulib;
|
{ lib, ulib, ... }: with ulib; merge
|
||||||
|
|
||||||
systemConfiguration {
|
(desktopSystemConfiguration {
|
||||||
|
security.sudo.wheelNeedsPassword = false;
|
||||||
|
})
|
||||||
|
|
||||||
|
(systemConfiguration {
|
||||||
security.sudo = enabled {
|
security.sudo = enabled {
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
Defaults timestamp_timeout=${if ulib.isDesktop then "-1" else "0"}
|
Defaults lecture = never
|
||||||
|
Defaults pwfeedback
|
||||||
|
Defaults env_keep += "DISPLAY EDITOR PATH"
|
||||||
|
${lib.optionalString ulib.isServer ''
|
||||||
|
Defaults timestamp_timeout = 0
|
||||||
|
''}
|
||||||
'';
|
'';
|
||||||
execWheelOnly = true;
|
execWheelOnly = true;
|
||||||
|
|
||||||
|
extraRules = [{
|
||||||
|
groups = [ "wheel" ];
|
||||||
|
commands = let
|
||||||
|
system = "/run/current-system";
|
||||||
|
store = "/nix/store";
|
||||||
|
in [
|
||||||
|
{
|
||||||
|
command = "${store}/*/bin/switch-to-configuration";
|
||||||
|
options = [ "SETENV" "NOPASSWD" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
command = "${system}/sw/bin/nix system";
|
||||||
|
options = [ "NOPASSWD" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
command = "${system}/sw/bin/nix-collect-garbage";
|
||||||
|
options = [ "SETENV" "NOPASSWD" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
command = "${system}/sw/bin/nix-env";
|
||||||
|
options = [ "SETENV" "NOPASSWD" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
command = "${system}/sw/bin/nix-store";
|
||||||
|
options = [ "SETENV" "NOPASSWD" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
command = "${system}/sw/bin/nixos-rebuild";
|
||||||
|
options = [ "NOPASSWD" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
command = "${system}/sw/bin/systemctl";
|
||||||
|
options = [ "NOPASSWD" ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}];
|
||||||
};
|
};
|
||||||
}
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue