I did exactly that.
I gave up smoking two years ago also by going cold turkey and when I was planning my whole weight loss out I gave myself a free week and as of a certain date I treated it just like smoking and just stopped it all and pretty much only ate whole foods for six months. Combined with daily exercise the weight just fell off me. I am a bit easier on it now and have the odd snack.
I live with my husband and son and I do all the shopping so pretty much they didn't have much choice
I live in a remote area and only go shopping once a month .. if that. So I don't have the temptation of shops to deal with either .. if it's not in the house then I just can't eat it.
Ice cream was something that I loved but still stayed in the house but I just had to use the willpower.
Im' not going to say it was easy and that I didn't want to eat somethign crap but getting rid of the crap really worked for me.