The tax follows months of talks between the country’s major political parties, farmers and environmental groups.