26 lines
		
	
	
		
			492 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			492 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
{
 | 
						|
  config,
 | 
						|
  lib,
 | 
						|
  ...
 | 
						|
}:
 | 
						|
with lib; {
 | 
						|
  options = {
 | 
						|
    security.sudoers = {
 | 
						|
      needsPassword = mkOption {
 | 
						|
        type = types.bool;
 | 
						|
        default = true;
 | 
						|
        description = "Whether users in the wheel group need to provide a password for sudo.";
 | 
						|
      };
 | 
						|
    };
 | 
						|
  };
 | 
						|
 | 
						|
  config = {
 | 
						|
    environment.etc."sudoers.d/wheel-no-password" = mkIf (!config.security.sudo.needsPassword) {
 | 
						|
      text = ''
 | 
						|
        %wheel ALL=(ALL) NOPASSWD: ALL
 | 
						|
      '';
 | 
						|
      # mode = "0440";
 | 
						|
    };
 | 
						|
  };
 | 
						|
}
 |