Cook the macaroni according to package directions. Drain and set aside.
While the macaroni cooks, melt the butter in a medium sauce pan. Add the chopped onion and pimientos. Cook over medium heat until they start to soften, about 2 minutes.
Add the flour all at once, stirring to dissolve lumps. Cook, stirring often, for about 5 minutes.
Pour in the milk in a thin stream, stirring non-stop to create a smooth sauce.
Add the grated cheese. Cook until the cheese melts.
Off the heat, season with enough salt to suit your taste.
Pour the cooked macaroni in a baking dish. Pour in the cheese sauce. Stir to blend. Smoothen the top with a spatula or the back of a spoon. Lay the slices of mild cheddar cheese on top.
Bake in a preheated 380F oven for 15 to 20 minutes until hot and bubbly.