Cook onions in butter over low heat until tender, about 5 minutes.
Blend the flour with the onions.
Add the milk and stir constantly until the mixture thickens.
Finally, add the cheese and stir until melted.
Spray the bottom of a 9 x 9 glass or ceramic baking pan with cooking spray.
Layer the bottom with egg slices.
Cover with half of the cheese sauce, half the potato chips, and half of the bacon.
Repeat layers.
Bake at 350 degrees for 30 minutes.